1
The fairly low default limits on PermGen and MaxHeap space cause a
2
great deal of trouble on Linux, partiularly when running Eclipse.
3
Fedora maintainers considered adding a special wrapper script to
4
Eclipse that sets "-XX:MaxPermSize=128m" or something similar, but
5
this would only solve the problem for Eclipse: non-Eclipse
6
applications would continue to be bitten the same way.
8
In the end, Sun's Java seems to be the only VM that is affected by the
9
PermGen limit, and there are many references on the web to confused
10
users hitting it and having no idea how to proceed. It makes sense
11
for Fedora and other Linux distros to bump the limit to something that
12
better fits the kinds of applications people are running.
14
There was some talk about removing these limits entirely, but:
16
1. It is sometimes useful to set a low limit for some processes in
17
order to prevent them going insane and monopolizing a machine. This
18
is particularly useful if a server is the subject of a denial of
21
2. The Java VM needs hit its own memory limit before the operating
22
decides to kills it, so that a proper log and stack trace can be
25
3. There may be other untoward consequences of removing these limits:
26
we don't think that the Java VM has ever been tested under such
27
conditions. It would take a very careful code audit to show that
28
simply removing the checks doesn't violate assumptions in the VM.
33
2007-10-08 Andrew Haley <aph@redhat.com>
35
* patches/icedtea-memory-limits.patch: New file.
36
Set maximum PermGen space to 128M, MaxHeap to 512M.
37
* Makefile.am (ICEDTEA_PATCHES): Add icedtea-memory-limits.patch.
39
--- openjdk/hotspot/src/share/vm/runtime/globals.hpp~ 2007-09-27 08:46:16.000000000 +0100
40
+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp 2007-10-05 19:06:32.000000000 +0100
45
- product(uintx, MaxHeapSize, ScaleForWordSize(64*M), \
46
+ product(uintx, MaxHeapSize, ScaleForWordSize(512*M), \
47
"Default maximum size for object heap (in bytes)") \
49
product_pd(uintx, NewSize, \
50
--- openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp~ 2007-09-27 08:45:59.000000000 +0100
51
+++ openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp 2007-10-05 19:02:37.000000000 +0100
55
define_pd_global(uintx, PermSize, ScaleForWordSize(16*M));
56
-define_pd_global(uintx, MaxPermSize, ScaleForWordSize(64*M));
57
+define_pd_global(uintx, MaxPermSize, ScaleForWordSize(128*M));
59
// Ergonomics related flags
60
define_pd_global(bool, NeverActAsServerClassMachine, false);