Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Java.lang.outofmemoryerror: permgen/meta space

2025-03-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

There is a phenomenon of permanent outofmemory, such as:

Java.lang.OutOfMemoryError: possible causes of PermGen/meta space errors:

1. Lack of space in PermGen

two。 Permanent memory leak

Solution:

1. Set-XX:+CMSClassUnloadingEnabled (must first set-XX:+UseConcMarkSweepGC)

This parameter indicates whether the class unloading feature is enabled when using the CMS garbage collection mechanism. By default this is set to not enabled. If CMSClassUnloadingEnabled is enabled, garbage collection cleans up the persistent generation and removes classes that is no longer in use.

two。 Increase the size of-XX:PermSize and-XX:MaxPermSize

The initial value of the permanent generation, which defaults to 1x64 of the physical memory, the maximum value of the permanent generation, and defaults to 1Comp4 of the physical memory. It is recommended to set it to 128 and 512 respectively.

If it is jdk1.8, set-XX:MetaspaceSize,-XX:MaxMetaspaceSize

3. Troubleshoot memory leaks

There are many reasons why applications encounter java.lang.OutOfMemoryError: PermGen space errors, most of which are caused by the uselessness of references to classes loaded by object or the program's class loader.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report