- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Java - JVM large heap size problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 12:58 AM
тАО06-17-2003 12:58 AM
Re: Java - JVM large heap size problem
OK that over with I've found the following which may help ....
Making the heap larger decreases the frequency of collections but makes each collection take longer. One good rule of thumb is that you should ensure that there is more than 50% free space available in the heap after a collection. With the -verbosegc flag on, it will print the amount of free space after each collection.
For server applications where swap space and physical memory are not concerns, it may be better to run with a very large heap to spread out the collections. For applications that have a stable heap resident set (i.e., they have a consistent amount of live data after each collection), you can set the initial and maximum heap sizes to be the same value. Setting the heap sizes to be 3-4 times the resident set will put the amount of free heap space in the 65-75% range.
Increasing the startup heap size will cause more system swap to be used. The user will have to balance heap requirements against swap usage. The -ms setting should be high enough that the system is not frantically doing garbage collection, but low enough that system resources are not being consumed too eagerly.
For example, your application needs between 12 and 16 MB. You would want to specify:
-ms32m -mx32m
This would prevent the JVM from trying to fit your app into 1 MB or 4 MB, and would also provide plenty of free space to improve gc performance.
For applications that have a widely varying resident set (or have a different resident set on different runs), try to leave the initial heap size at the default and set the maximum value large enough to handle the largest data set. An example of this kind of application is the Java compiler itself. When compiling small files, it doesn't use much heap space. When compiling lots of files (or very large ones) it uses a lot of space. By keeping the initial heap size low, it doesn't overuse the physical memory of the machine when compiling small files. The tradeoff is that compiling large files will cause the collector to go through some spasms in order to grow the heap to its desired size.
The default is 1 MB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 05:25 AM
тАО06-17-2003 05:25 AM
Re: Java - JVM large heap size problem
Thx, for the reply. Useful info regarding heap management, however I can't give you any points since you didn't actually address my problem/question at all :-(
Cheers,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 05:30 AM
тАО06-17-2003 05:30 AM
Re: Java - JVM large heap size problem
How much swap space do you have configured?
Swap is not only used to page out processes, it's also needed to reserve space "in case" it needs to page out.
When you start that java process, it will need to reserve that much swap space.
Post output of:
swapinfo -tam
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 05:36 AM
тАО06-17-2003 05:36 AM
Re: Java - JVM large heap size problem
You have to be able to fit this data size into BOTH swap & the maxdsiz_64bit space.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 06:02 AM
тАО06-17-2003 06:02 AM
Re: Java - JVM large heap size problem
doing some seach i always find that thery are using
-XmsSIZEm -XmxSIZEm
using equal SIZE values.
Instead i see that you specify different values (for min and max).
Did you try specifyng the same value, just to see if it is an application error when these value differ ? Maybe with 1500m each.
Just a try...
HHTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 06:46 AM
тАО06-17-2003 06:46 AM
Re: Java - JVM large heap size problem
I am not sure if it pertains to yiour case.
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066903282
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 06:58 AM
тАО06-17-2003 06:58 AM
Re: Java - JVM large heap size problem
Here is the output of swapinfo -tam :
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
dev 3000 0 3000 0% 0 - 2 /dev/vg00/lvol14
dev 3000 0 3000 0% 0 - 2 /dev/vg00/lvol15
reserve - 337 -337
memory 2628 68 2560 3%
total 9652 405 9247 4% - 0 -
and FYI, here are the current settings for the tunable kernel parameters (from /stand/system) :
STRMSGSZ 65535
create_fastlinks 1
dbc_max_pct 15
dbc_min_pct 2
default_disk_ir 1
fs_async 1
max_thread_proc 3000
maxdsiz 2063835136
maxdsiz_64bit 0X400000000
maxfiles 2048
maxfiles_lim 2048
maxssiz 0X04FB3000
maxssiz_64bit 0X10000000
maxswapchunks 4096
maxtsiz 0X40000000
maxtsiz_64bit 0X100000000
maxuprc 256
maxusers 512
ncallout 6000
nfile 30000
ninode 4000
nkthread 6000
nproc 2068
npty 200
nstrpty 200
shmmax 0X40000000
vps_ceiling 64
AFAIK, the java-out-of-the-box utility set these to high enough sensible values.
(maxdsiz_64bit is at 16gig)
Do you notice any problems with these settings ?
Do you attach any significance to the fact that the error is reporting an attempt to allocate a negative number of bytes?
Massimo:
Changing the Xmx and Xms values to be the same does not affect the behaviour in any way.
Regards & thanks,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 07:41 AM
тАО06-17-2003 07:41 AM
Re: Java - JVM large heap size problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 08:06 AM
тАО06-17-2003 08:06 AM
Re: Java - JVM large heap size problem
Thanks - I have read these installation notes also, but I was under the impression that this change was only necessary if you are embedding libjvm in a native application (e.g. if linking libjvm to a user-developed program, it would be necessary to chatr the resulting binary). Or am I misreading the release notes ?
I have already verified the patch level requirements and appear to be compliant.
Cheers,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2003 08:50 AM
тАО06-17-2003 08:50 AM
Re: Java - JVM large heap size problem
Just re-reading this thread and thought I'd better add some further info to clarify things.
Although in my original postings I referred to attempting to use Xmx2000m, I should note that this error is also reproduceable for me with Xmx as low as 1400m (which is even below the 1500-2000MB range discussed in the release notes above).
Can somebody confirm what the maximum allowed heap size should be for invoking the 64bit jvm in my environment?
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2003 10:33 AM
тАО06-18-2003 10:33 AM
Re: Java - JVM large heap size problem
Even bigger values like -Xmx5000m are OK. That can even exceed available swap, since the jvm mmaps that really big area with a MAP_NORESERVE flag to delay allocating swap.
I went back to trying 'smaller' values and they sometimes worked as well.
There are no clearly responsible failed system calls in tusc traces of the failing cases.
It seems that the jvm is using some bad rule for deciding memory allocation success, perhaps related fitting regions into open address range areas determined by examining pstat_procvm results.
By the way, the maxdsiz values do not limit the size of -Xmx settings. The maxdsiz limits are for the malloc/sbrk heap. The -Xmx limit is for the java's mmap based heap. Mmap regions don't count towards maxdsiz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2003 11:24 AM
тАО06-18-2003 11:24 AM
Re: Java - JVM large heap size problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-19-2003 04:23 AM
тАО06-19-2003 04:23 AM
Re: Java - JVM large heap size problem
This is indeed interesting news. Unfortunately, I am not in a position to test this right now as I am at a conference and the machine in question is hosting part of the conference website.
I will try your suggestions once the machine is free and post my results here (it will probably be next week). Meanwhile, if you find out any further information on the topic I would love to hear the details. Is this a known bug?
Thx and regards,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-19-2003 07:14 AM
тАО06-19-2003 07:14 AM
Re: Java - JVM large heap size problem
The conference just finished and I managed to sneak in some quick tests before the machines get shut down and shipped.
You were absolutely spot on the ball - removing the incremental garbage collection allowed me to specify any value for the Xmx , tested all the way up to 3000m.
Thx a lot and well spotted. Should have kept my points awards till after I tested so sorry about that. If you want to post another 1 line reply I'll award you 10 points for it!
I guess there should be a bug report created for this?
Cheers and all the best,
Morgan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-19-2003 09:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2003 01:48 PM
тАО06-25-2003 01:48 PM