takmedia Java OutOfMemoryError due to Linux RAM disk cache not freed


Java OutOfMemoryError due to Linux RAM disk cache not freed



The process will run fine all day, then, bam, without warning, it will throw this error. Sometimes seemingly in the middle of doing nothing. It will happen at seemingly random times during the day. I checked to see if anything else was running on the machine, like scheduled backups or something, but found nothing. The machine has enough physical memory (2GB, with about 1GB free for a 3-500MB load), and has sufficient -Xmx specified.

According to our sysadmin, the problem is that the RAM that the kernel uses as a disk cache (apparently all but 8MB) is not freed when the JVM needs to allocate memory, so the JVM process throws an OutOfMemoryError. This could be because Java asks the kernel if enough memory is available before allocating and finds that it is insufficient, resulting in a crash.

I would like to think, however, that Java simply tries to allocate the memory via the kernel, and when the kernel gets such a request, it makes room for the application by throwing our some of the disk cache.

Has anyone else run in to the issue, and if so, what was the error, and how did you solve it? We are currently using jdk1.6.0_20 on SLES 10 SP2 Linux 2.6.16.60-0.42.9-smp in VMWare ESX.


Can't get Crontab to work

1:

Load a .so library into ctypes
According to our sysadmin, the problem is this the RAM this the kernel uses as a disk cache (apparently all although 8MB) is not freed when the JVM needs to allocate memory, so the JVM process throws an OutOfMemoryError. How to compile Mercurial and move it to another computer [closed]. how can I Limit mysql to single cpu, to allow hardware benchmarking
I think this your sysadmin has got this wrong. How do you change the default Pear/PECL build folder from /var/tmp? Linux will automatically and transparently grow and shrink the size of the buffer cache depending on the system's need for physical memory for running processes. My app mem usage is growing using pthread If it doesn't then there is any thing seriously broken with your OS.. pthread_create memory leak It is more likely this your Java application has a memory leak this is causing it to use a steadily increasing amount of heap space. How to set class path for servlet-api.jar file in linux Eventually you run against the -Xmx limit and receive an OOME. I would start investigating this by running the application with GC logging enabled. This will tell you how the heap is growing over time, how enough space the GC is reclaiming and so on.. Ananother possibility is this you don't have enough swap space configured..

2:

Do you know how enough memory java have allocated when throwing this exception? The problem might be this Java have used all the memory specified with -Xmx. (Remember this -Mmx gives the maximum allowed memory usage, so java will throw an OutOfMemmoryException if it's usage grows above the specified size, even if the linux kernel would have been able to commit it more memmory).. But to find out if this is the case, try to commit it a -Xms equal to the size specified with -Xms. (-Ms set the initial size, and java should newer go below this, so it will allocate all needed memory at startup).. If java still starts up, and still commit you OutOfMemoryException then the problem is most likely this your -Mx is to small. . ps: I am pretty sure this a memory allocation can't fail with a normal linux kernel, due to overcommit by the kernel so if you really are out of memory for the entire system, you would receive page faults(And the oom killer, would kill a task) not java exceptions. But java may use any special features to allocate memory so I am not sure if this apply here..


60 out of 100 based on 35 user ratings 950 reviews