1834279 Members
1906 Online
110066 Solutions
New Discussion

Re: Out Of Memory ???

 
dhanish
Regular Advisor

Out Of Memory ???

Hi,
I am getting Java.Lang Out of Memory error when i run one of my application.Any clues ...what kernel params govern this or any other settings like ulimit and other things are reqd.
But i am not getting this error on the other machine having the same kernel param settings.

Any suggestions

thnks
Never Say Die
10 REPLIES 10
Steven Gillard_2
Honored Contributor

Re: Out Of Memory ???

Could be a few things:

1. You have hit a memory limit like maxdsiz or shmmax.

2. Your system does not have enough reservable swap space for the amount of memory the Java process wants. Check the available swap space with 'swapinfo -atm'.

3. You are starting a lot of threads in your Java app and are hitting max_thread_proc or nkthread.

The most common cause is number 3, because by default max_thread_proc is quite small and large java apps usually need a lot more. I suggest you increase max_thread_proc, and perhaps maxdsiz, shmmax and nkthread as well depending on what their current values are.

Also have a look at the Java FAQ:

http://www.hp.com/products1/unix/java/java2/sdkrte1_3/faq.html

Regards,
Steve
dhanish
Regular Advisor

Re: Out Of Memory ???

My kernel setting for
maxdsiz =0xC0000000
max_thread_proc =512
and swap info o/p is given below...


TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
dev 1000 0 1000 0% 0 - 0 /dev/vg00/lvol10
dev 1000 0 1000 0% 0 - 0 /dev/vg01/lvol18
dev 3000 0 3000 0% 0 - 0 /dev/vg01/lvol120
reserve - 1726 -1726
memory 13312 1539 11773 12%
total 19336 3265 16071 17% - 0
Never Say Die
Steven Gillard_2
Honored Contributor

Re: Out Of Memory ???

What about shmmax? I think Java uses a private mmap segment for its heap which is why I ask.

It might also help to get a tusc trace of the failing process, that way we'll know which system call is failing and what the errno value is.

Regards,
Steve
Olav Baadsvik
Esteemed Contributor

Re: Out Of Memory ???


Hi,

Things to check:

1. What heap-size do you specify when
you start the java application?
2. Required patches for java insalled?
You may download the HPjconfig tool
to check the patch-level and kernel
parameters. Download from www.hp.com/go/java
3. Check what arguments that are used
when starting java. I have seen
this option used:
-XX:+DisableExplicitGC which very
easily will give the error you see.

Regards
Olav
dhanish
Regular Advisor

Re: Out Of Memory ???

My settings for shmmax:0x40000000
Never Say Die
Steven Gillard_2
Honored Contributor

Re: Out Of Memory ???

Can you get a tusc trace? You can get tusc from:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.2/

Regards,
Steve
Carlos Fernandez Riera
Honored Contributor

Re: Out Of Memory ???

I think this URL will be very interesting for you.
unsupported
Carlos Fernandez Riera
Honored Contributor

Re: Out Of Memory ???

I think this URL will be very interesting for you.

http://dsportal.eservices.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1608,00.html
unsupported
dhanish
Regular Advisor

Re: Out Of Memory ???

Exception in thread "main" java.lang.OutOfMemoryError
<>


is this error related to memeory.
Never Say Die
Bill Hassell
Honored Contributor

Re: Out Of Memory ???

Most likely you are running 32bit applications and these are severely constrained on memory addressing. This includes having to share a highly fragmented memory space for shared memory. Read the 2 memory and process management documents in /usr/share/doc. Then get a copy of shminfo from:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/


Bill Hassell, sysadmin