The Artima Developer Community
Sponsored Link

Java Answers Forum
Max Heap Allocation Question

3 replies on 1 page. Most recent reply: Oct 12, 2004 8:37 AM by Lynn Hollerman

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ted Hill

Posts: 2
Nickname: tedh
Registered: Oct, 2004

Max Heap Allocation Question Posted: Oct 6, 2004 6:44 AM
Reply to this message Reply
Advertisement
Hello,

I am working on a memory-hungry Swing-based application that analyzes several GB of data.


We are running with Java 1.4 on Windows XP. To keep responsiveness up, we want to allocate as much memory to our application as possible and cache data to disk when necessary.


The maximum amount of heap space that we can allocate with JDK1.4 on XP is approx 1.6 GB ( -mx1638m ). The target machine itself has 2GB RAM.



MY QUESTION IS: are there any potential problems associated with allocating the full 1638m that XP will allow? (We haven't seen any yet.)



However one of my colleagues thinks there might be potential problems and feels that we should only allocate 80% of the max (approx 1.3 GB).


His thinking is that as long as we remain in 'pure Java' there should not be any problems, but JNI calls might lead to problems.


Just wondering if anyone else has an opinion on this.


Thanks,

Ted Hill


Robin Coe

Posts: 1
Nickname: rcoe
Registered: Oct, 2004

Re: Max Heap Allocation Question Posted: Oct 6, 2004 8:04 AM
Reply to this message Reply
I have the same question except under Linux. Would love a guru's opinion.

Ted Hill

Posts: 2
Nickname: tedh
Registered: Oct, 2004

Re: Max Heap Allocation Question Posted: Oct 12, 2004 6:44 AM
Reply to this message Reply
Perhaps the venerable Mr. Venners himself will grace us with a reply!

Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

Re: Max Heap Allocation Question Posted: Oct 12, 2004 8:37 AM
Reply to this message Reply
I've been there with a Solaris box - and there's still plenty I need to learn about it, so don't think any of this is definiative.

I hope you're taking into consideration the needs of your OS; Solaris isn't exactly memory-hungry, but it DOES use some memory, just like XP will. One thing I've run into is the notion that some in management seem to have that if they've gotten you a machine with xGB, you should be able to use all of that xGB for the application. Well, not quite. For instance, I found that on our system, while I was told that there was 4GB available to me, part of that was already allocated to the OS and some miscellaneous other daemons, and if I tried to set -Xmx to anything greater than about 2GB, I'd get a message about the OS needing to be formatted to be a 64-bit system from the JVM. I'm not sure if you'll run into this on XP, tho.

Also, if you allocate all the memory on your target machine to your process, and you're sure it doesn't spawn any child processes (that will require the JVM to duplicate itself, gobbling up more memory), you'd best be sure that no one is going to come along and try to run something else on the machine at the same time!

HTH!

Lynn.

Flat View: This topic has 3 replies on 1 page
Topic: Session beans Previous Topic   Next Topic Topic: Performance comparison between methods of TreeMap

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use