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 7.4 (Build 201310111528) VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18 OS: Windows 7 User Comments: GUEST: ??php?????? GUEST: Start the virtualbox. GUEST: <Please provide a description of the problem or the steps to reproduce>, GUEST: I'm not doing anything, it just crashed. GUEST: I don't know, as I didn't see the error happen. GUEST: DONT KNOW! GUEST: Switch between project groups GUEST: Shutdown IDE Cynara: error happened on start-up GUEST: OutOfMemoryError<Please provide a description of the problem or the steps to reproduce> GUEST: ?????? ????? ?????? ???????? ??-?? ?????? ????? ?? ???? ?????? ??????????? ??????. GUEST: ? GUEST: I have no idea how this happened GUEST: boh GUEST: just opened netbeans. GUEST: asd GUEST: damn GUEST: dont have a c GUEST: Waiting for background scanning, which takes forever. Out of Memort the moment I clicked the profiler button. I havent altered any heap space settings from the jvm defaults, this seems like a memory leak to me, happens when I open a particular project however I'm not aware of what it is about that project that NB doesnt like. Stacktrace: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2367) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415) at java.lang.StringBuilder.append(StringBuilder.java:132) at java.lang.StringBuilder.append(StringBuilder.java:179)
Created attachment 143575 [details] stacktrace
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=200994
And the winner is org.netbeans.modules.php.editor.PhpEmbeddingProvider which creates 2 nearly 150MB snapshots from 5M file - heapdump-710293. In the heapdump-707265 133MB snapshots are created from 777KB file.
Sorry, but everything seems to be ok on php.editor side. From that big file...PhpEmbeddingProvider just creates one big HTML embedding. From offset 63 with length 2772223. First 63 chars are properly skipped as PHP tokens. The rest of the file (html part) looks like: 2014-01-17 00:00:01 --- INFO: Executing minutely cron script 2014-01-17 00:01:01 --- INFO: Executing minutely cron script So it's not HTML at all...maybe HTML parser/lexer itself has a problem with it? Really don't know, but PHP part is imho ok. In fact this usecase is very uncommon. That problematic "php" file is just a log file with a php header (to ensure that noone will read that log file...probably it is accessible by URL). Imho not P2. Reassigning back for further evaluation, thanks. Just one thing...this implementation of PhpEmbeddingProvider is there since 2009 with just minor changes.
Look to the heap dump and think. > but everything seems to be ok on php.editor side Sounds a joke to me if you create 150MB from 700KB and saying everything is OK you are probably joking.
Here are important data to look for (owner). org.netbeans.modules.php.editor.PhpEmbeddingProvider.getEmbeddings(PhpEmbeddingProvider.java:123) Local Variable: java.util.ArrayList#9576 Local Variable: org.netbeans.api.lexer.TokenSequence#3 Local Variable: org.netbeans.api.lexer.TokenHierarchy#3 at org.netbeans.modules.parsing.impl.TaskProcessor.callEmbeddingProvider(TaskProcessor.java:583) at org.netbeans.modules.parsing.impl.SourceCache.getAllEmbeddings(SourceCache.java:307) Local Variable: java.util.ArrayList$Itr#19 Local Variable: java.util.HashSet#7895 Local Variable: java.util.LinkedHashMap#689 Local Variable: java.util.ArrayList#9577 Local Variable: org.netbeans.modules.php.editor.PhpEmbeddingProvider#2 Local Variable: org.netbeans.modules.parsing.api.Snapshot#3
Created attachment 145395 [details] Biggest Char[]
The attached screenshot shows a 133MB embedding (2 of them).
Created attachment 145396 [details] Snapshot The following screenshot may be also helpful. Showing Snapshot holding 66M chars -> 133MB, the snapshot is of type text/x-php5. The important pars are marked red.
Created attachment 145398 [details] PHP part patch Ok, so after offline discussion with Tomas, here is my PHP part patch...no html embeddings are created if their length is bigger than 5M.
Perfect Ondro! I am trying to do some general stuff when EmbeddingProvider creates an Embedding > 50MB ignore such an Embedding, and do not parse files > 50MB. The 50MB will be overridable by system property if someone needs to works with bigger files.
Great, thanks.
Well, so I'll push my patch to web-main and you will close this issue once you write your part? And e.g. tomorrow or on Friday we can backport our changes to 80_base branch if it will be created and changes will be propagated to main, right?
PHP part fixed in web-main #56778b95a8f3
The generic part fixed jet-main efc3977ff68b
Integrated into 'main-silver', will be available in build *201402200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/efc3977ff68b User: Tomas Zezula <tzezula@netbeans.org> Log: #239940:OutOfMemoryError: Java heap space
The generic part fix seems good to me.
Generic part transplanted bf3e5c6d1587, b598fe2d5faf
The PHP patch seems good to me.
PHP part transplanted in releases #d9789d6a437f
Integrated into 'releases/release80', will be available in build *201402202300* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/bf3e5c6d1587 User: Tomas Zezula <tzezula@netbeans.org> Log: #239940:OutOfMemoryError: Java heap space
I'm not able to reproduce it, verified. Thanks Product Version: NetBeans IDE 8.0 RC1 (Build 201402242200) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b67 Runtime: Java(TM) SE Runtime Environment 1.8.0-b126 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)