Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Segmentation fault when try to allocate buffer sizes larger than 256 MB

I am using a 64-bit JVM (Oracle), when i try to allocate buffer sizes larger than 256 MB it complains and throws a "segmentation fault" error. I and allocation direct memory buffers using java NIO, and transferring and receiving these objects to and from a RMI client program on same machine (Linux 64 bit).

Any idea?

like image 605
suleman Avatar asked May 27 '11 11:05

suleman


1 Answers

Segmentation Faults happen in programs (such as the JVM) due to memory errors. Either the JVM has a bug in it that makes it try to use the wrong section of memory on the computer when its cranked up to use that much buffer space, or it tries to allocate 256M of memory and in the process it uses more space than the computer gave it. In short, it sounds to me like the 64 bit JVM wasn't built to allocate that much space with its current settings. Perhaps you could try to configure the JVM so that it asks for more memory from the computer before it starts up. jtahlborn's comment on your asking what the max heap setting is on the JVM is also a question you should ask before you run the program again.

like image 141
djhaskin987 Avatar answered Oct 26 '22 11:10

djhaskin987