Why do I receive an OutofMemory error: PermGen space when calling MATLAB 7.0.4 (R14SP2) from Java?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I receive the following error when I call MATLAB from my Java program:
Java exception occurred:
java.lang.OutOfMemoryError: PermGen space
Respuesta aceptada
MathWorks Support Team
el 4 de Feb. de 2010
This is expected behavior.
The PermSpace holds objects describing classes and methods of the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen errors
For more information on garbage collection in Java, you may want to look at the item entitled:
Tuning Garbage Collection with the 1.4.2 Java Virtual Machine
<http://java.sun.com/docs/hotspot/gc1.4.2/>
To increase the Permanent generation heap space, create a java.opts file in the $MATLAB/bin/$ARCH
(Where $MATLAB is your root MATLAB directory and $ARCH is your architecture.)
or in the current directory when you start MATLAB, containing the following command:
-XX:MaxPermSize=128M
This will set the maximum permanent generation size of 128M on Sun JVM when starting the virtual machine. Be sure not to set the java heap bigger than the physical memory of the system.
NOTE: MathWorks has not tested MATLAB with any settings other than our default configuration.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Java Package Integration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!