2

I have a swing application when i run it on windows i have no problem with it but when i run it on linux i get the out of memory permgen exception after few time i am using it.

On windows i use jdk6 update 32 32bit, on linux i use the same jdk 6, same update version but 64bit.

The only thing that change when i run the application on windows/linux is the look and feel, when i run it on windows i use one, when i run it on linux i use another but they are both from jgoodies site.

What it can be the reason for this problem?

Thanks for the help

4

1 に答える 1

3

While you think this is a Windows versus Linux thing, I think that the more salient difference between the two systems is 32 bit versus 64 bit.

On a 64 bit JVM, references and reference-valued fields occupy twice as many bytes, and padding increases in other cases. Since a String object includes a reference field, etc, this could be sufficient to make the objects larger. And that could result in greater PermGen usage if you have lots of String literals or manually interned Strings.

Either way, the obvious solution is to increase the Permgen size via the JVM command line options. Indeed, apart from figuring out some way to reduce the application's Permgen usage (which may be impractical), this is probably the only solution.

于 2012-06-27T23:18:54.170 に答える