This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
This question is so tough, even the most senior engineers here at my company still dont know what is going on. To answer this question you need indepth knowledge of how java allocates its memory.
We are running a large business server written in java, it receives requests via corba interface, does some things, and passese on the request to be porcessed at some other location.
This is strange because its running on a HP server with over 4 gigs of memory, and the since of the app in the nt-process list says its was about 90 megs when it crash - so there was plenty memory!
Now, we have looked, I have look many people have looked, there is no memory leak in this app.
WHat is happening? Ive got a feeling its to do with the heap size, but shouldnt java just make a bigger heap if it sees it was need more memory ??
Would appricaite any input from anyone who knows how java works, how it allocotes memory, the role the heap plays, and has experience with the out of memory error!!
thanks guys! cheers !
PLEASE WATCH THIS VIDEO: <a href="http://www.glumbert.com/media/dolphin" target="_blank" rel="nofollow">http://www.glumbert.com/media/dolphin</a><br /> <br /><-- that video is no joke. Spread the word... this cant go on!!!<br /> <br />SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCMAD 1.0
3 possibilities: Windows will only allow a process to take 2Gig max. I believe this gets better post-Server 2003 Java 1.4 and before will only allow 1.5Gb anyway, this may limit you further. It may be the heap size. We had this too. It's another -XX option but I'll have to go look for it.
As you may have guessed, we have some app using large chunks of memory.
Ernest Friedman-Hill
author and iconoclast
Marshal
This is strange because its running on a HP server with over 4 gigs of memory, and the since of the app in the nt-process list says its was about 90 megs when it crash - so there was plenty memory!
Sun's JVMs (and most others) have a maximum Java heap size, set on JVM startup. When that heap is filled and garbage collection can't free any memory, you'll get an OutOfMemoryException. The default maximum Java heap size is 64MB, for a total OS memory usage of something like 90MB. It doesn't matter how much RAM the machine has in total -- the JVM won't allocate any more than its preset maximum heap size.
For Sun's JVMs, the command-line switch to set the maximum heap size looks like "-Xmx1234m", where "1234" is the number of megabytes of RAM to use for the Java heap. If you're not using a standard Sun JVM, then check the documentation for the appropriate switch to use.