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.

View | Details | Raw Unified | Return to bug 158421
Collapse All | Expand All

(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/Bundle.properties (+2 lines)
Lines 42-44 Link Here
42
OpenIDE-Module-Short-Description=Parsing API
42
OpenIDE-Module-Short-Description=Parsing API
43
OpenIDE-Module-Long-Description=Parsing API
43
OpenIDE-Module-Long-Description=Parsing API
44
44
45
ERR_NoUsageThreshold=The JVM does not support memory usage threshold, which is needed for the IDE. For more details, see: \
46
http://wiki.netbeans.org/NoMemoryUsageThreshold
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java (+35 lines)
Lines 4-11 Link Here
4
 */
4
 */
5
package org.netbeans.modules.parsing.impl;
5
package org.netbeans.modules.parsing.impl;
6
6
7
import java.lang.management.ManagementFactory;
8
import java.lang.management.MemoryPoolMXBean;
9
import java.lang.management.MemoryType;
10
import java.util.List;
11
import java.util.logging.Level;
12
import java.util.logging.Logger;
7
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
13
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
8
import org.openide.modules.ModuleInstall;
14
import org.openide.modules.ModuleInstall;
15
import org.openide.util.Exceptions;
16
import org.openide.util.NbBundle;
9
import org.openide.util.RequestProcessor;
17
import org.openide.util.RequestProcessor;
10
import org.openide.windows.WindowManager;
18
import org.openide.windows.WindowManager;
11
19
Lines 37-40 Link Here
37
        RepositoryUpdater.getDefault().stop();
45
        RepositoryUpdater.getDefault().stop();
38
        return ret;
46
        return ret;
39
    }
47
    }
48
49
    @Override
50
    public void validate() throws IllegalStateException {
51
        super.validate();
52
53
        long s = System.currentTimeMillis();
54
        try {
55
            List<MemoryPoolMXBean> pools = null;
56
            pools = ManagementFactory.getMemoryPoolMXBeans();
57
            for (MemoryPoolMXBean pool : pools) {
58
                if (pool.getType() == MemoryType.HEAP && pool.isUsageThresholdSupported()) {    //NOI18N
59
                    return ;
60
                }
61
            }
62
63
            IllegalStateException e = new IllegalStateException("Cannot listen on usage threshold");
64
65
            throw Exceptions.attachLocalizedMessage(e, NbBundle.getMessage(Installer.class, "ERR_NoUsageThreshold"));
66
        } finally {
67
            Logger log = Logger.getLogger(Installer.class.getName());
68
69
            if (log.isLoggable(Level.FINE)) {
70
                log.log(Level.FINE, "threshold supported check took: {0}", System.currentTimeMillis() - s);
71
            }
72
        }
73
    }
74
40
}
75
}

Return to bug 158421