Results 1 to 6 of 6
- 06-08-2010, 07:57 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
- 06-08-2010, 08:48 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
- 06-08-2010, 02:36 PM #3
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
My app had an outOfMemory Java heap error. I know that there are two reasons for it to happen either the max memory allocation is not enough or my app has a memory leak. My question is if I have to increase the max memory allocation, is there a way to know how much I have to increase? or is it just estimation
- 06-08-2010, 03:28 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Estimation.
It all comes down to figuring out what it is you're expecting the code to do (that is show big the structures it's expected to work with are)...and profiling. The latter will also help to find memory leaks, or potential memory hot spots where you may be holding onto more data in memory than you actually need to.
- 06-08-2010, 03:52 PM #5
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
- 06-08-2010, 04:22 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
They'll be the default, which is 2Mb initial (Xms) and 64Mb max (Xmx).
By the way, Jos has a typo above..it's Xss for the stack size. Xms is the start memory size.
I will usually define a size for a web server simply because I have never been involved in a project where 64Mb would be sufficient. Also, once you know how much memory your system needs then you may as well set Xms to the same as Xmx since it removes the need for the JVM to grab memory as it's running, and can improve performance after a restart.
Similar Threads
-
Are my comments correct?
By twiggy62 in forum New To JavaReplies: 2Last Post: 02-08-2010, 05:34 AM -
Getting correct output
By WarmRegards in forum New To JavaReplies: 9Last Post: 11-01-2009, 04:41 PM -
Using Scanner to compute an average of the values
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:36 PM -
Is my Pseudocode correct?
By Clemenza1983 in forum New To JavaReplies: 0Last Post: 01-29-2008, 04:07 AM -
To correct forum
By Jman in forum IntroductionsReplies: 3Last Post: 01-18-2008, 02:33 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks