You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Olaf Kock <to...@olafkock.de> on 2017/12/22 13:00:01 UTC
Re: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
On 22.12.2017 13:48, Eric Robinson wrote:
> We have multiple JVMs deployed on two identical Linux servers. Each server has 60 JVMs. Until today, both servers were running Tomcat6 with JDK 1.6. Today we upgraded one of the servers to Tomcat 8 with JDK 1.8. Now the JVMs on the Tomcat 8 server are each using between 20-80% more memory than the ones on Tomcat6 with JDK 1.6. Is that normal? Why would that be? Is it some kind of settings? Is it fixable?
>
It might be as simple as different thresholds for the garbage collector
to kick in.
I'd start with an evaluation of how much memory is used right after a GC
run - and in case this isn't satisfactory, which objects use the memory.
Typically it's appropriate to just look at the top of the list.
Note that the GC algorithms (or just GC defaults) between the different
JVM versions (sometimes even between minor upgrades) might differ
significantly. One big question is: Did you explicitly configure memory
consumption, GC algorithm and thresholds? If so, what's the difference
between the two options: I'd expect that you need to change the settings
significantly in order to achieve the same behavior. There's a lot of
work that has been done in this world.
That being said, I'd also not rule out that tomcat's or other
component's implementation changed - e.g. caches, or just memory use
through upgraded libraries. But I'd recommend to look in both
directions, with JDK and GC tuning being the elephant in the room,
giving you the biggest bang for your buck.
Olaf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
Posted by Eric Robinson <er...@psmnv.com>.
> Eric,
>
> Just curious how much ram do you have in the server and cpu resources.
>
> #free -m and # cat /proc/cpuinfo | egrep 'cores|processor'
>
> (Not to insult your intelligence , I am just specifying what I was curious to see)
>
> And it's always easier to copy/paste than to think.
>
> I see in another thread you went from Java 1.6_xxx to 1.8_xxx
>
> That could be the whole story right there.
>
>
No offense taken. You're right, copy and paste is easier...
[root@app17 alley]# free -m
total used free shared buffers cached
Mem: 64415 58110 6304 0 2938 18382
-/+ buffers/cache: 36789 27626
Swap: 15999 759 15240
[root@app17 alley]# cat /proc/cpuinfo | egrep 'cores|processor'
processor : 0
cpu cores : 6
processor : 1
cpu cores : 6
processor : 2
cpu cores : 6
processor : 3
cpu cores : 6
processor : 4
cpu cores : 6
processor : 5
cpu cores : 6
processor : 6
cpu cores : 6
processor : 7
cpu cores : 6
processor : 8
cpu cores : 6
processor : 9
cpu cores : 6
processor : 10
cpu cores : 6
processor : 11
cpu cores : 6
--Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat 6?
Posted by "Cheltenham, Chris" <cc...@philasd.org>.
Eric,
Just curious how much ram do you have in the server and cpu resources.
#free -m and # cat /proc/cpuinfo | egrep 'cores|processor'
(Not to insult your intelligence , I am just specifying what I was curious
to see)
And it's always easier to copy/paste than to think.
I see in another thread you went from Java 1.6_xxx to 1.8_xxx
That could be the whole story right there.
===========================
Thank You;
Chris Cheltenham
Technology Services
The School District of Philadelphia
Work # 215-400-5025
Cell # 215-301-6571
-----Original Message-----
From: Eric Robinson [mailto:eric.robinson@psmnv.com]
Sent: Friday, December 22, 2017 2:59 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than
Tomcat 6?
> > From: Eric Robinson [mailto:eric.robinson@psmnv.com]
> > Subject: RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory
> > Than
> Tomcat 6?
>
> > if JVM instance "A" is configured as follows on server 1 under
> > tomcat6/jdk
> 1.6, then
> > instance "A" on server 2 is configured the same, except it is
> > running
> under tomcat
> > 8/jdk 1.8. Yet the tomcat 8 ones used 50% more memory, on average.
>
> > JAVA_OPTS="-Xms16M -Xmx192M \
> > -XX:MaxPermSize=192M \
>
> Note that PermGen is no longer used in Java 8, and the above should
> log a
> warning:
>
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
> MaxPermSize=192m; support was removed in 8.0
Great tip, thanks.
Unfortunately, I don't think that explains why the exact same Xms and Xmx
settings produce vastly different resident and virtual running image sizes
under jdk1.8 versus jdk1.6.
> It might be leaking.
If that were the case, I assume it would manifest under tomcat6/jdk 1.6 as
well. Since it does not, I am inclined to think leakage is not the issue.
--Eric
---------------------------------------------------------------------
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: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
Posted by Eric Robinson <er...@psmnv.com>.
> > From: Eric Robinson [mailto:eric.robinson@psmnv.com]
> > Subject: RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than
> Tomcat 6?
>
> > if JVM instance "A" is configured as follows on server 1 under tomcat6/jdk
> 1.6, then
> > instance "A" on server 2 is configured the same, except it is running
> under tomcat
> > 8/jdk 1.8. Yet the tomcat 8 ones used 50% more memory, on average.
>
> > JAVA_OPTS="-Xms16M -Xmx192M \
> > -XX:MaxPermSize=192M \
>
> Note that PermGen is no longer used in Java 8, and the above should log a
> warning:
>
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
> MaxPermSize=192m;
> support was removed in 8.0
Great tip, thanks.
Unfortunately, I don't think that explains why the exact same Xms and Xmx settings produce vastly different resident and virtual running image sizes under jdk1.8 versus jdk1.6.
> It might be leaking.
If that were the case, I assume it would manifest under tomcat6/jdk 1.6 as well. Since it does not, I am inclined to think leakage is not the issue.
--Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Eric Robinson [mailto:eric.robinson@psmnv.com]
> Subject: RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than
Tomcat 6?
> if JVM instance "A" is configured as follows on server 1 under tomcat6/jdk
1.6, then
> instance "A" on server 2 is configured the same, except it is running
under tomcat
> 8/jdk 1.8. Yet the tomcat 8 ones used 50% more memory, on average.
> JAVA_OPTS="-Xms16M -Xmx192M \
> -XX:MaxPermSize=192M \
Note that PermGen is no longer used in Java 8, and the above should log a
warning:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m;
support was removed in 8.0
Here's a brief overview:
https://blogs.oracle.com/poonam/about-g1-garbage-collector,-permanent-genera
tion-and-metaspace
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat 6?
Posted by "Cheltenham, Chris" <cc...@philasd.org>.
Eric,
If you have upgraded java along with tomcat then yes that it is very
probable.
You can restrict how much memory java can use however, if it is consuming
too much memory.
-Xmx and –Xms startup parameters.
However, you may be jeopardizing performance.
In this case you can only add more memory.
It may also be leaking.
Java is a pig get used to it.
===========================
Thank You;
Chris Cheltenham
Technology Services
The School District of Philadelphia
Work # 215-400-5025
Cell # 215-301-6571
From: Eric Robinson [mailto:eric.robinson@psmnv.com]
Sent: Friday, December 22, 2017 2:04 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat
6?
Posted by Eric Robinson <er...@psmnv.com>.
> On 22.12.2017 13:48, Eric Robinson wrote:
> > We have multiple JVMs deployed on two identical Linux servers. Each server
> has 60 JVMs. Until today, both servers were running Tomcat6 with JDK 1.6.
> Today we upgraded one of the servers to Tomcat 8 with JDK 1.8. Now the JVMs
> on the Tomcat 8 server are each using between 20-80% more memory than the
> ones on Tomcat6 with JDK 1.6. Is that normal? Why would that be? Is it some
> kind of settings? Is it fixable?
> >
> It might be as simple as different thresholds for the garbage collector to kick in.
> I'd start with an evaluation of how much memory is used right after a GC run -
> and in case this isn't satisfactory, which objects use the memory.
> Typically it's appropriate to just look at the top of the list.
>
> Note that the GC algorithms (or just GC defaults) between the different JVM
> versions (sometimes even between minor upgrades) might differ significantly.
> One big question is: Did you explicitly configure memory consumption, GC
> algorithm and thresholds? If so, what's the difference between the two options:
> I'd expect that you need to change the settings significantly in order to achieve
> the same behavior. There's a lot of work that has been done in this world.
>
> That being said, I'd also not rule out that tomcat's or other component's
> implementation changed - e.g. caches, or just memory use through upgraded
> libraries. But I'd recommend to look in both directions, with JDK and GC tuning
> being the elephant in the room, giving you the biggest bang for your buck.
>
> Olaf
>
The following startup options are typical for our JVMs. The min, max, and permgen settings may differ from JVM to JVM on the same server, but the settings are always identical between servers. In other words, if JVM instance "A" is configured as follows on server 1 under tomcat6/jdk 1.6, then instance "A" on server 2 is configured the same, except it is running under tomcat 8/jdk 1.8. Yet the tomcat 8 ones used 50% more memory, on average.
JAVA_OPTS="-Xms16M -Xmx192M \
-XX:MaxPermSize=192M \
-Djvm=$JVM_ID \
-Djava.awt.headless=true \
-Djava.net.preferIPv4Stack=true \
-Duser.timezone=US/Pacific \
-Xloggc:/alley/site098/tomcat8/logs/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCDetails