>I am getting an out of memeory exception error running a java program
> on Windows 32 bit.
[quoted text clipped - 5 lines]
> a ceratin way to use it, that's why my question is whether Java is
> capable of accessing 8GB memory on Windows 32 bit?
Java is limited to about 1.5-1.9 GB (YMMV) on Win 32 machines. You have to
shift up to 64-bit JVM on the appropriate hardware to get a larger range.
Matt Humphrey http://www.iviz.com/
zigzagdna@yahoo.com - 24 Nov 2007 22:58 GMT
> <zigzag...@yahoo.com> wrote in message
>
[quoted text clipped - 14 lines]
>
> Matt Humphreyhttp://www.iviz.com/
Windows OS has /3GB swtch which allows for 3GB user addressable space
(instead of 2GB),
so I will think java should be able to access close to 3GB (sighlt
less than 3GB). I do
not know where java heap size parameter comes into play as for as 2GB
or 3GB memory per process.
Arne Vajhøj - 24 Nov 2007 23:28 GMT
> Windows OS has /3GB swtch which allows for 3GB user addressable space
> (instead of 2GB),
> so I will think java should be able to access close to 3GB (sighlt
> less than 3GB). I do
> not know where java heap size parameter comes into play as for as 2GB
> or 3GB memory per process.
Java can not use that extra GB.
I assumes it has to do with that Java's memory need to be contiguous
and that something small just get in above the 2 GB mark.
64 bit !!
Arne
zigzagdna@yahoo.com - 25 Nov 2007 00:45 GMT
> zigzag...@yahoo.com wrote:
> > Windows OS has /3GB swtch which allows for 3GB user addressable space
[quoted text clipped - 12 lines]
>
> Arne
3GB swich gives contigous 3GB memory to user address space.
Basically in Windows 32 bit, of 4B - 2GB (contigous) is accessible by
kernel and other 2GB by user address space. With 3GB switch, kernel
uses only 1GB, so user address space has more memory (up to 3GB). This
is a soltion to provide more memory if one cannot switch to 64bit
which is the best solution.
I have used this feature in conjunction with Oracle. It does not
require any changes in one's
program. I will be really surprised if Java or any other application
cannot use it.
Arne Vajhøj - 25 Nov 2007 00:50 GMT
>> Java can not use that extra GB.
>>
[quoted text clipped - 14 lines]
> program. I will be really surprised if Java or any other application
> cannot use it.
I know what /3GB does.
Read what I write.
Java can not use that extra GB.
I guess it is because something else it putting something
in around the 2 GB mark.
Arne
zigzagdna@yahoo.com - 25 Nov 2007 02:35 GMT
> zigzag...@yahoo.com wrote:
> >> Java can not use that extra GB.
[quoted text clipped - 28 lines]
>
> - Show quoted text -
Arne:
Thanks. I am curious where it is documented it cannot use more than
2GB even when /3GB switch is on, just asking.
Arne Vajhøj - 25 Nov 2007 02:44 GMT
>> Java can not use that extra GB.
> Thanks. I am curious where it is documented it cannot use more than
> 2GB even when /3GB switch is on, just asking.
I do not think I have ever seen an official statement.
But Google find a ton of references:
http://forum.java.sun.com/thread.jspa?threadID=576811
http://forum.java.sun.com/thread.jspa?threadID=621332
http://www.unixville.com/~moazam/
But when Googling I found this:
http://dev2dev.bea.com/blog/hstahl/archive/2005/12/how_to_get_almo.html
Sounds as if BEA JVM can handle a split heap and thereby utilize
the /3GB switch. Could be wort trying.
Arne
zigzagdna@yahoo.com - 25 Nov 2007 03:37 GMT
> zigzag...@yahoo.com wrote:
> >> Java can not use that extra GB.
[quoted text clipped - 11 lines]
>
> Arne
Arne:
Thanks a million.
Prem
> I am getting an out of memeory exception error running a java program
> on Windows 32 bit.
[quoted text clipped - 5 lines]
> a ceratin way to use it, that's why my question is whether Java is
> capable of accessing 8GB memory on Windows 32 bit?
Not from a single process (JVM).
64 bit !
Arne
> I am getting an out of memeory exception error running a java program
> on Windows 32 bit.
[quoted text clipped - 5 lines]
> a ceratin way to use it, that's why my question is whether Java is
> capable of accessing 8GB memory on Windows 32 bit?
The Java virtual machine won't necessarily automatically allocate all of
your available memory, it has built in minimums and maximums.
If you're using Suns JVM, try adding -Xmx512M
That sets the max heap size to 512 megs. Experiment with that value.
Cation, don't set it too high either, as you'll degrade the performance
of your garbage collector.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
zigzagdna@yahoo.com - 24 Nov 2007 22:55 GMT
On Nov 24, 1:16 pm, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
> zigzag...@yahoo.com wrote:
> > I am getting an out of memeory exception error running a java program
[quoted text clipped - 18 lines]
> --
> Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
I am somewhat confused wih this switch, my progam is a third party
program which uses
Apache tomcat, so tomcat5 process is started and my third party
application is
integerated with tomcat. I see tomcat5 process started and I access
third part program's web site, thread count (increases for tomcat5 and
memory usgae increases. I will be suprised if tomcat5 cannot access
memory up to 2GB. Is max heap size per thread or for enitre jvm (i.e.
tomcat5 process).
Prem
Daniel Pitts - 25 Nov 2007 00:06 GMT
> On Nov 24, 1:16 pm, Daniel Pitts
> <newsgroup.spamfil...@virtualinfinity.net> wrote:
[quoted text clipped - 31 lines]
>
> Prem
that switch is per JVM, in your startup scripts, you need to tune your
memory settings.
Java (and therefore tomcat) won't automatically allow all available
memory to be allocated, since this would add a performance bottleneck
for garbage collection.
Tomcat has a memory FAQ:
<http://tomcat.apache.org/faq/memory.html>

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>