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.
Summary: | Parsing huge C source file leads to GC limit exceed, sometimes NB hangs up | ||
---|---|---|---|
Product: | cnd | Reporter: | mariusz_m |
Component: | Code Model | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | out of mem - messages log |
Description
mariusz_m
2016-04-04 05:56:06 UTC
Please provide additional info: - IDE message log - Heap dump What? Heap dump? I don't understand what you talking about. I'm only user, not NB developer ;) Beside, if my description is not enough to reproduce, it means the problem with parsing big files does not exists on your side, does it ? (In reply to mariusz_m from comment #2) > What? Heap dump? I don't understand what you talking about. I'm only user, > not NB developer ;) > Beside, if my description is not enough to reproduce, it means the problem > with parsing big files does not exists on your side, does it ? Hi, Unfortunately your problem description is not enough to understand a problem. At first we need an IDE message log (http://wiki.netbeans.org/FaqLogMessagesFile). Java heap dump (http://wiki.netbeans.org/FaqMemoryDump) makes possible to analyze root cause of memory lack. Instead of heap dump (it is very big) you can attach a threads dump (http://wiki.netbeans.org/GenerateThreadDump). Probably it will be enough. Of course, IDE has a problem with parsing huge files. To solve such problem IDE parser has a limit of file token stream (as i remember 8,000,000 tokens and IDE will consume about 1g to parse such file). You can try ti increase java heap size by option: -J-Xmx3g Created attachment 159121 [details]
out of mem - messages log
Please find the heap dump here: https://drive.google.com/open?id=0B_TIY3RAz3G0dHA4YXBhdG1CZnM It's 80MB, uncompressed 400MB. I see Java option -Xmx512m. I'm sure that IDE will have a lack of memory with 512Mb heap memory. I'd recommend to use at least -J-Xmx2g According to heap dump the biggest objects: 150Mb in 1,943 instances of org.clang.lex.SmallVectorToken 120Mb in 2,497,407 instances of org.clang.lex.Token (In reply to Alexander Simon from comment #6) > I see Java option -Xmx512m. > I'm sure that IDE will have a lack of memory with 512Mb heap memory. > I'd recommend to use at least -J-Xmx2g > > According to heap dump the biggest objects: > 150Mb in 1,943 instances of org.clang.lex.SmallVectorToken > 120Mb in 2,497,407 instances of org.clang.lex.Token These 120 are included in the above 150. So, the problem is with default Xmx which was assigned to JVM for running NB (512Mb). You can control it in $NB/etc/netbeans.conf file http://wiki.netbeans.org/FaqSettingHeapSize I would recommend to put there -J-Xmx2G and you will not have problems Hi, setting maximum heap to 2GB helped - no more exception during opening the project. Also, setting initial heap size to 1GB instead of 32MB greatly improved the startup time :) For the future: How about suggesting the user to modify these setting in case of error? Extend this manual https://performance.netbeans.org/howto/jvmswitches/index.html and point it when out of memory exception happened ? This will save your time. Thanks, Mariusz |