Improved Java Memory/Performance Defaults

Bug #568823 reported by Gabriel Nell
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Confirmed
Wishlist
Unassigned
tomcat7 (Ubuntu)
Confirmed
Undecided
Unassigned
tomcat8 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: tomcat6

Forking an issue from #541520

The current default of a 128MB heap does not make sense. This was chosen when Java 1.4 had a default maximum heap size of 64MB. In Java 1.5 and later, the JVM will automatically size the heap based on available memory. So the current default setting actually unnecessarily sets a limit on the memory available to tomcat, when not setting anything at all would actually allow the modern JVMs to do a better job.

References:
http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#par_gc.ergonomics.default_size
http://java.sun.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html

***
initial heap size:
Larger of 1/64th of the machine's physical memory on the machine or some reasonable minimum. Before J2SE 5.0, the default initial heap size was a reasonable minimum, which varies by platform. You can override this default using the -Xms command-line option.

maximum heap size:
Smaller of 1/4th of the physical memory or 1GB. Before J2SE 5.0, the default maximum heap size was 64MB. You can override this default using the -Xmx command-line option.
***

Revision history for this message
Gabriel Nell (gabriel-nell) wrote :

Attaching proposed patch.

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the patch, which version is this for?

chuck

Changed in tomcat6 (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

This will be for Maverick, and discussed at UDS in the "Tomcat improvements" session.

Revision history for this message
Gabriel Nell (gabriel-nell) wrote :

An additional possibility is to specify the JVM using the "-server" flag. Although Java also will auto-set this based on the machine "class", currently it will only choose the server JVM one machines with 2GB+ of RAM and 2 cores. Interestingly, the 32bit instances offered by EC2 (a popular choice for hosting web frontends) have 1.7GB of RAM, which would cause the client VM to be auto-selected.

http://java.sun.com/docs/hotspot/HotSpotFAQ.html#compiler_types
http://java.sun.com/j2se/1.5.0/docs/guide/vm/server-class.html

Emmanuel Bourg (ebourg)
Changed in tomcat7 (Ubuntu):
status: New → Confirmed
Changed in tomcat8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tomcat8 - 8.0.37-1

---------------
tomcat8 (8.0.37-1) unstable; urgency=medium

  * Team upload.
  * New upstream release
  * Removed 0001-set-UTF-8-as-default-character-encoding.patch (fixed upstream)

 -- Emmanuel Bourg <email address hidden> Mon, 19 Sep 2016 09:37:33 +0200

Changed in tomcat8 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.