This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215063

Summary: OutOfMemoryError: PermGen space
Product: third-party Reporter: Exceptions Reporter <exceptions_reporter>
Component: -- Other --Assignee: Geertjan Wielenga <geertjan>
Status: NEW ---    
Severity: normal CC: ag_sachin81, arkadycc, bclemens, jkovalsky, tzezula
Priority: P1 Keywords: PERFORMANCE
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 190336
Attachments: stacktrace

Description Exceptions Reporter 2012-07-02 11:44:38 UTC
This bug was originally marked as duplicate of bug 204748, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.2 Beta (Build 201205031832)
VM: Java HotSpot(TM) Client VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows XP

User Comments:
GUEST: compiling a program

GUEST: Reviewing my Tasks

GUEST: I started up the IDE and got this error while initializing my open projects.




Stacktrace: 
java.lang.OutOfMemoryError: PermGen space
   at java.lang.ClassLoader.defineClass1(ClassLoader.java:0)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at org.netbeans.memorymonitor.MemoryMonitor$Memeater.loadNext(MemoryMonitor.java:419)
   at org.netbeans.memorymonitor.MemoryMonitor$Memeater.run(MemoryMonitor.java:352)
   at java.lang.Thread.run(Thread.java:722)
Comment 1 Exceptions Reporter 2012-07-02 11:44:44 UTC
Created attachment 121649 [details]
stacktrace
Comment 2 Tomas Zezula 2012-07-11 07:39:14 UTC
Too many classes (interned strings).
Comment 3 Petr Cyhelsky 2012-07-11 09:31:57 UTC
Caused by memory Meter plugin
Comment 4 Tomas Hurka 2013-02-12 14:56:14 UTC
'Memory Meter' plugin <http://plugins.netbeans.org/plugin/5664/memory-monitor> is causing OOME in NetBeans after it is installed. The JDK example you are using has the following code:

    // Test thread to consume memory
    static class Memeater extends ClassLoader implements Runnable {
        Object y[];
        public Memeater() {}
        @Override
        public void run() {
            y = new Object[10000000];
            int k =0;
            while(true) {
                 if (k == 5000000) k=0;
                 y[k++] = new Object();
                 try {
                     Thread.sleep(20);
                 } catch (Exception x){}

                 // to consume perm gen storage
                 try {
                     // the classes are small so we load 10 at a time
                     for (int i=0; i<10; i++) {
                        loadNext();
                     }
                 } catch (ClassNotFoundException x) {
                   // ignore exception
                 }

           }

        }
}

This thread eats memory and perm gen. So anybody, who installs this plugin will get OOME in NetBeans in a few minutes. Please remove the plugin from plugin center until this is fixed.