>I tried to increase the swap file size in windows but then also it didn't
>work. Can somebody help in pointing out how it can be increased.
Your OS has a limit too. In windows you might try increasing the size
of the swap file. Go into control Panel System.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
I think Sun's JVM 1.5 is not designed for heavy computing. I also have
the same problem.
-Xmx can only be set as high as the real RAM. The paging of the OS is
not leveraged. A toy. Not professional software.
The authors of the JVM fell into the M$FT trap of thinking the authors
are much smarter than the users. I have a problem which is too large
for the RAM and I am happy to leverage the OS's paging - but with Java
I cannot. In may case the problem is created when I try to serialize a
tree of array lists containing 1 to 10M objects. It's beyond the
capabilities of Java.
So now I must re-design to do my own serialization or otherwise break
the problem into small chunks appropriate for the RAM-only virtual
machine I am using.
Am I out in left field or does the JVM truly not allow me to use the
pagefile?
TimJowers
ref:
http://www.talkbackforum.com/index.jsp?selection=Question%20of%20the%20month%3A%
20OutOfMemoryError&fromURL=http%3A//www.javaperformancetuning.com/news/qotm036.s
html
So, I try a few permutations:
# java with -Xmx2048m -Xss3m
Error occurred during initialization of VM
Could not reserve enough space for object heap
# java with -Xmx2048m -Xss3m -XX:MaxPermSize=256m
Error occurred during initialization of VM
Could not reserve enough space for object heap
timjowers@gmail.com - 12 Jan 2006 17:23 GMT
Update:
This works:
-Xmx1612m -Xss3m
This does not:
-Xmx1580m -Xss3m -XX:MaxPermSize=256m
Nor this:
-Xmx1613m -Xss3m
There must be some less-documented setting for the JVM memory
management which sets the amount of additional space over the available
RAM which may be used. Ideas?
The machine has ~716MB of pagefile used and ~372 available. 4200MB is
allocated presently for the pagefile swap.
Thomas Hawtin - 12 Jan 2006 18:22 GMT
> I think Sun's JVM 1.5 is not designed for heavy computing. I also have
> the same problem.
> -Xmx can only be set as high as the real RAM. The paging of the OS is
> not leveraged. A toy. Not professional software.
Have you tried using a JVM which is almost as large as physical RAM.
Garbage collection in such a situation is not pretty. Only really
suitable for toy programs.
> The authors of the JVM fell into the M$FT trap of thinking the authors
> are much smarter than the users. I have a problem which is too large
Not usually difficult.
> for the RAM and I am happy to leverage the OS's paging - but with Java
> I cannot. In may case the problem is created when I try to serialize a
> tree of array lists containing 1 to 10M objects. It's beyond the
> capabilities of Java.
Perhaps that's not a sensible thing to do, even if you could allocate
the virtual memory.
> Am I out in left field or does the JVM truly not allow me to use the
> pagefile?
Of course it allows you to swap.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Steve W. Jackson - 12 Jan 2006 20:38 GMT
> I think Sun's JVM 1.5 is not designed for heavy computing. I also have
> the same problem.
[quoted text clipped - 28 lines]
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
Why do you persist in the belief that the -Xmx setting cannot exceed the
actual RAM? It can if the amount of RAM present is below the allowable
limit for -Xmx, which is dependent on the architecture and OS. Whether
or not it performs well -- based on available virtual memory (aka swap
space) is a different matter.

Signature
Steve W. Jackson
Montgomery, Alabama
Nigel Wade - 13 Jan 2006 10:36 GMT
> I think Sun's JVM 1.5 is not designed for heavy computing. I also have
> the same problem.
[quoted text clipped - 14 lines]
> Am I out in left field or does the JVM truly not allow me to use the
> pagefile?
I think you will find that it's the OS which is the "toy", not the JVM.
The JVM has no control over the allocation of memory, or how much memory it can
allocate. If you ask the JVM for a pool of 2GB, the JVM will ask the OS to
allocate it. If the OS is unable (or unwilling) to provide 2GB even when it has
it, then it's the OS which is the toy, not the JVM.
For example, on my system, which has 1GB of RAM and 2GB of swap I can run this:
java -Xmx2600m -Xss3m
Ditch the toy, and get a real OS ;-)

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555