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.
Created attachment 144802 [details] messages.log Briefly, I'm trying to debug an application and both java and gdb alternately start burning 100% of the cpu. I have netbeans configured for 1.5GB of memory, but eventually java runs out when it hits this limit. I don't have any watches set, and it takes about one minute to step one line in the debugger. My guess is that NB. Interestingly, although I get an exception, the ide's reporting mechanism does not show up. So if I just let the ide/gdb sit for a while, the memory consumption windows declines to under 1GB. At that point I can step one line, and the memory consumption begins to rise quickly. Eventually, netbeans exited on its own and deleted the gdb log.
After hitting step twice, the gdb log in /tmp had grown to 105MBytes. It appears the load comes from trying to render very, very large unsigned char arrays over and over. There either needs to be some smarts in the ide side of the debugger or some settings that will limit the number of characters rendered. Product Version: NetBeans IDE Dev (Build 201402040001) Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Linux version 3.12.6-200.fc19.x86_64 running on i386; UTF-8; en_US (nb) User directory: /home/toddb/.netbeans/dev Cache directory: /home/toddb/.cache/netbeans/dev
Created attachment 144805 [details] gdb log (compressed with bzip2)
Running gdb by hand and printing out the same varibles yields about 100 bytes per array out of 2MBytes.
And if I change the declaration of the arrays from unsigned char * to void *, the gdb log remains small and performance is good. changing declarations is not acceptable. Please fix.
see also memory dump in bug #241410
*** Bug 241408 has been marked as a duplicate of this bug. ***
Fixed in http://hg.netbeans.org/cnd-main/rev/7aad436e1942 Could be checked by creating a very big array of chars and while debugging point to it with a mouse to get tooltip. Tooltip should appear quickly and without significant memory changes. Also string in tooltip should be truncated.
> Could be checked by creating a very big array of chars ... and fill it with non-null chars. Sorry, I know this is completely obvious to most of you.
Integrated into 'main-silver', will be available in build *201402220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/7aad436e1942 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixed #241409 - netbeans maxes out on memory -- set gdb limit on number of returned elements in arrays (default limit x2).
In this case I see correct tooltip and Variables tab: const int MAX = 1000000; int main(int argc, char** argv) { // unsigned char s[MAX]; unsigned char* s = new unsigned char[MAX]; s[MAX - 1] = '\0'; for (int i = 0; i < MAX - 2; i++) { s[i] = '*'; } return 0; } In this case array breaks debugger: const int MAX = 1000000; int main(int argc, char** argv) { unsigned char s[MAX]; // unsigned char* s = new unsigned char[MAX]; s[MAX - 1] = '\0'; for (int i = 0; i < MAX - 2; i++) { s[i] = '*'; } return 0; } Scenario: - Set Line breakpoint at "return 0;" line - Start debugger - Open Variables tab - Expand 's' node - Press "Finish Debugger Session" button ==> IDE can't finish debugger for a lot of time
>const int MAX = 1000000; > >int main(int argc, char** argv) { > unsigned char s[MAX]; >// unsigned char* s = new unsigned char[MAX]; > s[MAX - 1] = '\0'; > for (int i = 0; i < MAX - 2; i++) { > s[i] = '*'; > } > return 0; >} I suppose the issue you described is not connected to this one. If the issue is reproducible please file another bug.
fix is safe
Product Version = NetBeans IDE Dev (Build 201402250001) (#e8eed61bc137) QA verified bug. Now IDE truncates big tooltip.
(In reply to petrk from comment #11) > I suppose the issue you described is not connected to this one. If the issue > is reproducible please file another bug. issue 242313 are created
Petr, please integrate into release80
Integrated into 'releases/release80', will be available in build *201403022200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/732881972f92 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixed #241409 - netbeans maxes out on memory -- set gdb limit on number of returned elements in arrays (default limit x2). (transplanted from 7aad436e19426f093f7e0cee7fd5d5561ff2cee5)
verified in NetBeans IDE 8.0 (Build 201403052200)
verified in NetBeans IDE 7.4 (Build 20140320-3f80b6998498)
Integrated into 'releases/release74', will be available in build *201403261440* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/884e97833a1b User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixed #241409 - netbeans maxes out on memory -- set gdb limit on number of returned elements in arrays (default limit x2). (transplanted from 7aad436e19426f093f7e0cee7fd5d5561ff2cee5)