You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ch...@labware.com on 2011/11/30 07:28:47 UTC

Maximum memory that can be assigned to Tomcat on windows platform

Hi , 
         Is there any cap on maximum memory that can be assigned to tomcat 
on 32 bit Windows machines ? I have found out that even if we have 8GB 
memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also 
found this thread which reinforces what I have been seeing ? We are using 
Tomcat 7.0.19 . 

www.theserverside.com/discussions/thread.tss?thread_id=48793

Regards,

Subhrajyoti  Choudhury 
WebLIMS Developer 
Mobile: +919830079545
Mail: choudhury@labware.com
Web: www.labware.com

LabWare LIMS Solutions - Results Count

Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Stefan Mayr <st...@mayr-stefan.de>.
Am 30.11.2011 12:08, schrieb john@gniffelnieuws.net:
> On Wed, 30 Nov 2011 16:14:45 +0530, Choudhury wrote
>> Hello ,
>>          The question is not why I would use 32 bit JVM , the
>> question is whether there is any maximum limit on memory for Tomcat
>> and if yes why ? Regards,

The limit is the JVM, not Tomcat itself

> It depends on the windows version used actually. From what I remember this is
> limited to maximum 2GB for user processes. The easiest way to test is, is with
> a small app that shows some memory information like:
> public class MaxMemory {
>      public static void main(String[] args) {
>          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)");
>      }
> }
>
> Try to run it with different options for the heap. I would be surprised if you
> would get over 1600MB.

This is what we experienced: up to 1GB Heap (Xmx) was stable on all servers.
Heaps larger were very prone to crashes. We've seen a maximum of 1.2GB 
Heap on Windows with 32bit JVMs

That's why we have switched to 64bit JVMs on all machines. No need to 
swap JVM editions when applications require more memory - just increase 
Xmx as long as RAM is available.

   Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by jo...@gniffelnieuws.net.
On Wed, 30 Nov 2011 16:14:45 +0530, Choudhury wrote
> Hello , 
>         The question is not why I would use 32 bit JVM , the 
> question is whether there is any maximum limit on memory for Tomcat 
> and if yes why ? Regards,
>
It depends on the windows version used actually. From what I remember this is
limited to maximum 2GB for user processes. The easiest way to test is, is with
a small app that shows some memory information like:
public class MaxMemory {
    public static void main(String[] args) {
        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)");
    }
}

Try to run it with different options for the heap. I would be surprised if you
would get over 1600MB.  
 
--
/(bb|[^b]{2})/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Pid * <pi...@pidster.com>.
On 30 Nov 2011, at 10:45, "Choudhury@labware.com" <Ch...@labware.com> wrote:

> Hello ,
>        The question is not why I would use 32 bit JVM , the question is
> whether there is any maximum limit on memory for Tomcat and if yes why

No. Tomcat has no knowledge of the memory capacity of the JVM.


p


> ?
> Regards,
>
> Subhrajyoti
> Mobile: +919830079545
> Mail: choudhury@labware.com
> Web: www.labware.com
>
> LabWare LIMS Solutions - Results Count
>
>
>
> From:   Francis GALIEGUE <fg...@one2team.com>
> To:     Tomcat Users List <us...@tomcat.apache.org>
> Date:   11/30/2011 01:51 PM
> Subject:        Re: Maximum memory that can be assigned to Tomcat on
> windows platform
>
>
>
> On Wed, Nov 30, 2011 at 07:28,  <Ch...@labware.com> wrote:
>> Hi ,
>>        Is there any cap on maximum memory that can be assigned to
> tomcat
>> on 32 bit Windows machines ? I have found out that even if we have 8GB
>> memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also
>> found this thread which reinforces what I have been seeing ? We are
> using
>> Tomcat 7.0.19 .
>>
>> www.theserverside.com/discussions/thread.tss?thread_id=48793
>>
>
> In any event, a 32bit JVM (1.6, I don't know for lower VMs) cannot
> allocate more than 3 GB heap space.
>
> "With so much RAM, why do you still use a 32bit OS and JVM" is the
> question here.
>
> --
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> fge@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Wed, Nov 30, 2011 at 11:44,  <Ch...@labware.com> wrote:
> Hello ,
>        The question is not why I would use 32 bit JVM , the question is
> whether there is any maximum limit on memory for Tomcat and if yes why ?


The question _is_ why you use a 32bit OS and JVM with 8 GB RAM. Tomcat
is not limited in memory usage by itself, it is the JVM which limits
what it can consume.

In the best of cases (32bit Linux and 32bit Sun 1.6 JVM), you are
limited to a 3 GB heap size.

Use a 64bit OS and JVM.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Ch...@labware.com.
Hello , 
        The question is not why I would use 32 bit JVM , the question is 
whether there is any maximum limit on memory for Tomcat and if yes why ?
Regards,

Subhrajyoti 
Mobile: +919830079545
Mail: choudhury@labware.com
Web: www.labware.com

LabWare LIMS Solutions - Results Count



From:   Francis GALIEGUE <fg...@one2team.com>
To:     Tomcat Users List <us...@tomcat.apache.org>
Date:   11/30/2011 01:51 PM
Subject:        Re: Maximum memory that can be assigned to Tomcat on 
windows platform



On Wed, Nov 30, 2011 at 07:28,  <Ch...@labware.com> wrote:
> Hi ,
>         Is there any cap on maximum memory that can be assigned to 
tomcat
> on 32 bit Windows machines ? I have found out that even if we have 8GB
> memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also
> found this thread which reinforces what I have been seeing ? We are 
using
> Tomcat 7.0.19 .
>
> www.theserverside.com/discussions/thread.tss?thread_id=48793
>

In any event, a 32bit JVM (1.6, I don't know for lower VMs) cannot
allocate more than 3 GB heap space.

"With so much RAM, why do you still use a 32bit OS and JVM" is the
question here.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



RE: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Ilya Kazakevich <Il...@JetBrains.com>.
>> That is just stupid since 32bit cannot address more
>> than 4GB of memory no matter what you do. Any sysadmin should know
>> that right?

>That's per process. All reasonably recent 32-bit OSs can address way
>more than 4GiB internally.

Yes, but one region in memory is reserved for IO. Drivers use high memory
addreses (>3Gb) to speak with their devices.
To support more than 3Gb on Win/32bit PAE could be used so IO would reside
higher than 4Gb. 
But in this situation drivers need to deal with 64bit pointers. 
Microsoft believes it would lead to driver fails and BSODs, so it denied it
for desktop versions of OSes. But it works in server versions.
Idea was: "4Gb is rarely needed on desktop and desktop has cheap hardware
and poorly-written drivers.  And on server they have good hardware and good
drivers and often require more than 4Gb."

You could use +4Gb on Win2008/32bit but you _can't_ use more than about
3.5Gb on Win7@32bit. 


BTW process could access more than 4Gb too (see AWE:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366527(v=vs.85).as
px) but AFAIK Sun JVM does not use it

>If you have relatively small processes, there's no need for
>the overhead of 64-bit even if you have 16GiB or more.

You can run 32bit apps on 64bit windows (that's called WoW64). Processor and
Windows support it and it works pretty well.

Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com
"Develop with pleasure!"


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Wed, Nov 30, 2011 at 22:38, André Warnier <aw...@ice-sa.com> wrote:
[...]
>
> I am not knowledgeable at all in such questions, and while you are at it let
> me ask a question :
> Does the fact of having a system with a 64-bit CPU (and OS) necessarily (or
> usually) imply that data transfers between CPU and RAM happen also 64-bit in
> parallel ?
>

No, this depends on the bus width, not the address space. And bus
widths nowadays are rather in the range of 256/512 bits.

> For example, let' suppose that I have an application which handles a very
> large table of integers (the integers themselves being < 2exp31), and that
> periodically all elements of this table have to be updated.
> My understanding is that under a 32-bit platform, each integer will occupy
> 32 bit, while on a 64-bit platform each will occupy 64 bit (the source
> program remaining the same).
>
> If there is not a corresponding 64-bit parallel transfer between CPU and
> memory, then using a 64-bit CPU would be detrimental, no ?
> Or is this a non-sensical case nowadays ?
>

This depends on the alignment the JVM uses. If it aligns to 8 bytes,
then yes, any integer will take up 8 bytes, but so will any byte. In
general, the alignment is 4 bytes, except for long values of course.

With a 4 byte alignment, this means you can store two ints in a
register, and it's then only a matter of logical ands/shifting to
obtain the value you want. And these operations are ultra fast ;)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Ilya Kazakevich <Il...@JetBrains.com>.
>>Does the fact of having a system with a 64-bit CPU (and OS) necessarily
(or usually) imply 
>>that data transfers between CPU and RAM happen also 64-bit in parallel ?
That depends on front bus width. Modern PCs has 64-bit bus AFAIK.

In "64-bit CPU" 64 is register size and nothing else (although 86x64 mode
has some differences with IA32)

>>My understanding is that under a 32-bit platform, each integer will occupy
32 bit, while 
>>on a 64-bit platform each will occupy 64 bit (the source program remaining
the same).
Java integers are always 32bit, are not they?

C int may vary from 16 (in BCC 3.1 for DOS) to 64. 

64-bit processor mode gives you ability to:
1) address more memory (2^64 bytes theoretically).
2) store more data in register so CPU could now operate 64bit numbers and
you need one operation to do something with two 64bit objects opposite to
two operations on 32bit.
3) v86 mode is disabled so you can't run 16bit apps :)
4) use new registers, new SSE instructions and so on:
http://en.wikipedia.org/wiki/X86-64#Architectural_features



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by André Warnier <aw...@ice-sa.com>.
Francis GALIEGUE wrote:
> On Wed, Nov 30, 2011 at 18:51, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
> [...]
>> Running a machine with more than 4GiB in 32-bit mode isn't stupid at
>> all IMO. If you have relatively small processes, there's no need for
>> the overhead of 64-bit even if you have 16GiB or more.
>>
> 
> This is quite the opposite: a 32bit OS has _more_ overhead than a
> 64bit OS when running on a 64bit CPU.
> 
> Just consider filesystem calls such as read(), write(), seek(): their
> arguments are 64bits, not 32, and have been so before 64bit was even
> common (2+ GB files are common place today). With a 32bit OS on a
> 64bit CPU, you eat up two registers whereas a 64bit OS will take only
> one.
> 
> And of course, this is without considering wasted TLB space or the
> sheer time to address just one memory page.
> 

I am not knowledgeable at all in such questions, and while you are at it let me ask a 
question :
Does the fact of having a system with a 64-bit CPU (and OS) necessarily (or usually) imply 
that data transfers between CPU and RAM happen also 64-bit in parallel ?

For example, let' suppose that I have an application which handles a very large table of 
integers (the integers themselves being < 2exp31), and that periodically all elements of 
this table have to be updated.
My understanding is that under a 32-bit platform, each integer will occupy 32 bit, while 
on a 64-bit platform each will occupy 64 bit (the source program remaining the same).
If there is not a corresponding 64-bit parallel transfer between CPU and memory, then 
using a 64-bit CPU would be detrimental, no ?
Or is this a non-sensical case nowadays ?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


[OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Wed, Nov 30, 2011 at 18:51, Christopher Schultz
<ch...@christopherschultz.net> wrote:
[...]
>
> Running a machine with more than 4GiB in 32-bit mode isn't stupid at
> all IMO. If you have relatively small processes, there's no need for
> the overhead of 64-bit even if you have 16GiB or more.
>

This is quite the opposite: a 32bit OS has _more_ overhead than a
64bit OS when running on a 64bit CPU.

Just consider filesystem calls such as read(), write(), seek(): their
arguments are 64bits, not 32, and have been so before 64bit was even
common (2+ GB files are common place today). With a 32bit OS on a
64bit CPU, you eat up two registers whereas a 64bit OS will take only
one.

And of course, this is without considering wasted TLB space or the
sheer time to address just one memory page.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Casper,

On 11/30/11 3:37 AM, Casper Wandahl Schmidt wrote:
> Another question to ask is, why do you have 8GB memory when
> running 32bit? That is just stupid since 32bit cannot address more
> than 4GB of memory no matter what you do. Any sysadmin should know
> that right?

That's per process. All reasonably recent 32-bit OSs can address way
more than 4GiB internally.

For example:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%29.aspx#memory_limits

This is generally done through PAE
(http://en.wikipedia.org/wiki/Physical_Address_Extension) which allows
32-bit OSs to access more than 4GiB at the kernel level, though each
process is still limited to 4GiB.

Running a machine with more than 4GiB in 32-bit mode isn't stupid at
all IMO. If you have relatively small processes, there's no need for
the overhead of 64-bit even if you have 16GiB or more.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7WbQYACgkQ9CaO5/Lv0PBsWwCgnifhHtqrLUBi7K4PeDjp4hnC
JMkAn0gilsNy2hv3zu3nzUkrmrzxoYWF
=AZpI
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Wed, Nov 30, 2011 at 09:37, Casper Wandahl Schmidt
<ka...@gmail.com> wrote:
>
[...]
>>
> Another question to ask is, why do you have 8GB memory when running 32bit?
> That is just stupid since 32bit cannot address more than 4GB of memory no
> matter what you do. Any sysadmin should know that right?
>
> disclaimer: I'm not a sysadmin, if I'm wrong please teach me :)
>

With PAE[1] you actually can address up to 2^36 RAM (therefore 64 GB).
But not all OSes support that, and anyway the addressable memory at
one time (and therefore max memory theoretically accessible to one
process at any given moment) is still 2^32.

[1] Physical Address Extension

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Casper Wandahl Schmidt <ka...@gmail.com>.

Den 30-11-2011 09:21, Francis GALIEGUE skrev:
> On Wed, Nov 30, 2011 at 07:28,<Ch...@labware.com>  wrote:
>> Hi ,
>>          Is there any cap on maximum memory that can be assigned to tomcat
>> on 32 bit Windows machines ? I have found out that even if we have 8GB
>> memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also
>> found this thread which reinforces what I have been seeing ? We are using
>> Tomcat 7.0.19 .
>>
>> www.theserverside.com/discussions/thread.tss?thread_id=48793
>>
> In any event, a 32bit JVM (1.6, I don't know for lower VMs) cannot
> allocate more than 3 GB heap space.
>
> "With so much RAM, why do you still use a 32bit OS and JVM" is the
> question here.
>
Another question to ask is, why do you have 8GB memory when running 
32bit? That is just stupid since 32bit cannot address more than 4GB of 
memory no matter what you do. Any sysadmin should know that right?

disclaimer: I'm not a sysadmin, if I'm wrong please teach me :)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Wed, Nov 30, 2011 at 07:28,  <Ch...@labware.com> wrote:
> Hi ,
>         Is there any cap on maximum memory that can be assigned to tomcat
> on 32 bit Windows machines ? I have found out that even if we have 8GB
> memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also
> found this thread which reinforces what I have been seeing ? We are using
> Tomcat 7.0.19 .
>
> www.theserverside.com/discussions/thread.tss?thread_id=48793
>

In any event, a 32bit JVM (1.6, I don't know for lower VMs) cannot
allocate more than 3 GB heap space.

"With so much RAM, why do you still use a 32bit OS and JVM" is the
question here.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Maximum memory that can be assigned to Tomcat on windows platform

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Subhrajyoti,

On 11/30/11 1:28 AM, Choudhury@labware.com wrote:
> Is there any cap on maximum memory that can be assigned to tomcat 
> on 32 bit Windows machines?

See this week's thread called "Server crash for memory limit" for some
information about that.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7Wak0ACgkQ9CaO5/Lv0PAOzACgoFatvhsCE8sMoDnWFAKOFqpp
5IsAn2MvLYj5kszAFXfaZstjdQaQ/8sU
=hvCT
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org