Solve
Outofmemoryerror:permgen Space
, the process is painful, the result is comfortable
Recently own program in
Redeploy
When redeploying, the old hint
Outofmemoryerror:permgen
Space
Error, searching the network for relevant data, but after doing it, there is still the problem. By
For the first time I have ever encountered this problem,
It cost me
2
Days time,
The process is more painful,
The result is still a comparison
satisfactorily. I wrote down my experience for my own reference, and also to share it with you.
On the web about
OutOfMemoryError:
PermGen
Space
A lot of solutions, but there are
The method is to forward each other, true and false difficult to distinguish. Some may also be misleading.
My environment is
Myeclips
8.5
、
tomcat6.x
,
After trying a lot of ways,
Like what:
Document
《
Linux
And
Windows
Modify
Java
Virtual Machine Memory Size "
(
http://duanfei.iteye.com/blog/1189541
)
,
In the way,
I've tried it all,
Or not
Line
And, of course, a lot of other information.
And then further study
Jvm
of optimization, etc.,
I just want to know.
The memory parameters I configured should be large enough,
Why is it still overflowing,
Did not take effect,
Then I need to find
What are the memory parameters that the system recognizes after configuration?
Refer to the knowledge on the network,
Started the
Jdk
Bring your own work
With
In
\jdk1.6.0_10\bin
The following
Jconsole.exe
Memory Monitoring Tools,
Click to enter as follows:
Choose
Pid
For
4472
of this process,
Click
, enter the following interface,
Select the memory page, and select the "Memory Pool" of the last option in the chart
Perm Gen
”
, the following detailed information shows
Is that:
The maximum value of this place is
65536Kb
, namely
64M,
So I found out why,
64M
Will definitely lead to overflow,
But I have configured hundreds of megabytes of memory space is not effective.
Attention
This is where I
Myclipse
Start in the
Tomcat
See the results.
Next, I entered
Bin/catalina.bat
In the file, "
REM-----Execute The requested Command-
"This
Add the following statement to the back of the
Set java_opts=%java_opts%-xms256m-xmx1024m
-xx:permsize=256m-xx:maxnewsize=256m-xx:maxpermsize=512m
, this place takes note of the increased bit
is placed in
REM-----Execute The requested Command
–
Back, Best
Set java_opts=%java_opts%
And this one has to be added,
There are many documents on this network that do not account for this location,
Or that's not the place,
Is
Not anywhere else, I didn't try. I started it manually.
Tomcat
In
Cmd
Status input:
Startup
And then
See
Jconsole.exe
Details
Perm Gen
Memory is the memory I have configured
521M
, it's in effect.
.
But I was
Myclipse
Start in
Tomcat
, re-deploy the program, the error remains. Original document
《
Linux
And
Windows
Modify
Java
Virtual Machine Memory Size "
(
http://duanfei.iteye.com/blog/1189541
) mentioned in
If it is through
MyEclipse
Start
Tomcat
Modify
MyEclipse
Configuration options
Open options
..
Input
Tomcat
Key words
,
Then open it.
Server
The following
Jdk
There will be a
Area
Optional Java VM arguments.
Join directly
-xms128m-xmx512m
There is a loophole in this place,
Join directly
“
-xms128m-xmx512m
”
,
Should be
“
-xms256m-xmx512m
-xx:permsize=256m-xx:maxpermsize=512m
”
, this is the
Myclipse
In force. If not
-xx:permsize=256m-xx:maxpermsize=512m
So
PermGen
The memory is always
64M
。 After modification, the heavy
Kai
Tomcat
, redeploy, memory no longer overflows.
On my machine is:
Servers/tomcat/tomcat 6.X/JDK
In the
Optional Java VM Arguments
:
。 Find the reason, the solution is naturally very simple.
Watch this place.
Servers/tomcat/tomcat 6.x
This place also has a parameter:
Optional Program
Arguments
, this feeling does not work very much, I also have no effect after the modification, I thought that modifies this place to be possible
, which led me to take a detour.
OutOfMemoryError PermGen Space Solution (headache for a few days)