The Artificial Intelligence Forum                             data mining forum
This forum is to discuss artificial intelligence. You can ask anything about artificial intelligence : science-fiction, robots, consciousness, movies and so on! Also, you can discuss anything related to implementing artificial intelligence in machines such as programming, algorithms, etc. No registration is required!  
Memory allocation for individual method or function (Java)
Posted by: Dev
Date: November 27, 2019 07:34PM

1) Is there a way to allocate memory for each method or function in java

2) Is there a way to allocate memory for each thread in java

This is to avoid out of memory exception of the application when a particular function goes wrong....

Else the entire application is getting crashed

Options: ReplyQuote
Re: Memory allocation for individual method or function (Java)
Date: November 28, 2019 12:28AM

Hi,

No there is not a way to specifically do that. The Java Virtual Machine uses the same memory space for the whole Java program.

To see what is using the most memory in your program, you could use a Java profiler, that is a program that will spy on your virtual machine and tell you what is using the most memory. Then maybe it can help you to find where the memory problem comes from and you can try to optimize how you use the memory in your program.


Best regards,
Philippe

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.