I am doing some fancy stuff, where I really need to allocate about 1 GB.
My Computer has 8GB 64 bit System, so that's not a problem.
I use -Xmx 4g to increase my heap space, but sadly enough that doesn't work at all.
I use:
Runtime rt = Runtime.getRuntime();
long totalMem = rt.totalMemory();
long maxMem = rt.maxMemory();
long freeMem = rt.freeMemory();
double megs = 1048576.0;
System.out.println ("Total Memory: " + totalMem + " (" + (totalMem/megs) + " MiB)");
System.out.println ("Max Memory: " + maxMem + " (" + (maxMem/megs) + " MiB)");
System.out.println ("Free Memory: " + freeMem + " (" + (freeMem/megs) + " MiB)");
Which shows me:
Total Memory: 259522560 (247.5 MiB
Max Memory: 259522560 (247.5 MiB)
Free Memory: 0 (0 MiB)
I really don't know what I am doing wrong. Does anyone of you have an idea?
Thanks a lot!