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.
Build: NetBeans IDE 8.0.2 (Build 201411181905) VM: Java HotSpot(TM) 64-Bit Server VM, 25.25-b02, Java(TM) SE Runtime Environment, 1.8.0_25-b17 OS: Mac OS X User Comments: GUEST: NetBeans freezes during a debugging session of a javascript program with chrome connector. The debugger do not seem to like web workers... GUEST: it got stuck while editing and using inspect property carlneto: html5 editing GUEST: Was debuggin a javascript class Stacktrace: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3332) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421) at java.lang.StringBuffer.append(StringBuffer.java:272) at org.json.simple.JSONArray.toJSONString(JSONArray.java:91)
Created attachment 154467 [details] stacktrace
The message that debugger received just before OOME, has 82 MB. The full JSON object received by debugger has 500 MB! It contains a nodes array, which has 240000 elements. It came as "DOM.setChildNodes" notification. This is a bad design of the debugging protocol, that it can send such insane amount of data.
org.netbeans.modules.web.webkit.debugging.api.dom.Node does not clean all properties from the underlying JSON. It retains "nodes", which is an array of other JSON objects, it retains "params", "nodeValue", etc. This is why Node has retains size close to the retain size of JSONObject. But the core of the problem seems to be 220 MB retain size of WebKitPageModel.
Mistakenly moved instead of issue #254959. Please ignore the previous comment.
The heapdumps 791379 and 791038 show more than 100000 elements in the inspected page. Some time ago I added a warning for the user if this happens: https://hg.netbeans.org/web-main/rev/6c82c8d42e2a The heapdump 784142 shows the problem mentioned by Martin, i.e., huge message (82M) describing 240000 sub-nodes comes from Chrome. I have added a warning when we are about to request sub-node information for an element having more than 20000 sub-nodes: https://hg.netbeans.org/web-main/rev/7b0700c9e7fa The warnings allow the user to stop page inspection and inform him/her that (s)he may run into OutOfMemoryError if (s)he continues with the inspection/debugging.