This content has been marked as final. Show 6 replies
Thanks for your replies guys. I have 512mb of ram, and even if I did not have 64MB ram wouldn't the OS use Virtual Memory before throwing an out of memory exception? Also another peculiar thing I noticed is
ByteBuffer buffer = ByteBuffer.allocateDirect((int) Math.pow(2,25));
ByteBuffer buffer = ByteBuffer.allocate((int) Math.pow(2,25));
ByteBuffer buffer = ByteBuffer.allocateDirect((int) Math.pow(2,26));
ByteBuffer buffer = ByteBuffer.allocate((int) Math.pow(2,26));
both did'nt work (i.e threw an Out of memory error) I would expect
allocateDirect to work in this case not neccesarly allocate
Check how big your max heap space is set to. It may be that your java configuration does not allow more than 64 megs of heapspace.
Max heap space is specified using the VM argument -Xmx512M (512 megs as an example).
edit also see here:
Edited by: endasil on Nov 18, 2007 10:22 PM
I did set the heap size to 512 but that didn't help (As expected). I probably am missing something very obvious but I don't understand why java heap space is relevant here. From doc I get the idea that allocateDirect allocates space in the system memory space and only reference to the allocated memory are stored in the java heap.