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.

Bug 117103 - java.lang.OutOfMemoryError: Java heap space
Summary: java.lang.OutOfMemoryError: Java heap space
Status: RESOLVED INCOMPLETE
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker with 1 vote (vote)
Assignee: Winston Prakash
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-29 17:15 UTC by jiai
Modified: 2009-04-15 10:54 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 380


Attachments
stacktrace (44 bytes, text/plain)
2007-09-29 17:16 UTC, jiai
Details
stacktrace (44 bytes, text/plain)
2007-10-02 15:28 UTC, marco_bresciani
Details
stacktrace (44 bytes, text/plain)
2007-10-03 16:50 UTC, jiai
Details
stacktrace (44 bytes, text/plain)
2007-10-05 13:51 UTC, serkandurusoy
Details
Threaddump with jstack; Exception 21220 (13.33 KB, text/plain)
2008-01-21 14:25 UTC, jiai
Details
Threaddump (13.47 KB, text/plain)
2008-01-27 13:13 UTC, jiai
Details
Threaddump (16.99 KB, text/plain)
2008-01-31 17:07 UTC, jiai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jiai 2007-09-29 17:15:55 UTC
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows 2000, 5.0, x86

User Comments: 
Standard installation on a 1 GB memory W2K Workstation; the VisualWeb project contains a _single_ JSP page!
Comment 1 jiai 2007-09-29 17:16:08 UTC
Created attachment 49796 [details]
stacktrace
Comment 2 marco_bresciani 2007-10-02 15:28:48 UTC
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 3 marco_bresciani 2007-10-02 15:28:50 UTC
Created attachment 50002 [details]
stacktrace
Comment 4 jiai 2007-10-03 16:50:21 UTC
Build: NetBeans IDE Dev (Build 200710030000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows 2000, 5.0, x86

User Comments: 
Trying to open the plugins window.

512 MB heap space should be enough for 4  projects with round about 100 files total and _no_ file is opened in the editor!
Comment 5 jiai 2007-10-03 16:50:24 UTC
Created attachment 50119 [details]
stacktrace
Comment 6 serkandurusoy 2007-10-05 13:51:45 UTC
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
Comment 7 serkandurusoy 2007-10-05 13:51:47 UTC
Created attachment 50263 [details]
stacktrace
Comment 8 Jiri Prox 2007-10-08 12:48:10 UTC
Please, can you capture thread dump just before the exceptions occur? Thanks
Comment 9 spaquet 2007-10-19 20:23:45 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 10 pkuisman 2007-10-26 16:01:36 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 11 gidravlic 2007-11-02 22:53:18 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 12 Peter Pis 2007-11-04 19:01:23 UTC
To reporter: Please attach thread dump.
Comment 13 rudobaum 2007-11-13 10:20:32 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 14 Exceptions Reporter 2007-11-15 21:41:41 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 15 Jiri Vagner 2007-12-05 10:49:26 UTC
To reporter: Please attach thread dump.
Comment 16 Exceptions Reporter 2007-12-14 15:17:39 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 17 Exceptions Reporter 2007-12-18 07:10:50 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 18 Exceptions Reporter 2007-12-20 18:53:57 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 19 Peter Pis 2008-01-14 08:44:03 UTC
To reporter: Could you please attach the thread dump? Thanks

http://wiki.netbeans.org/wiki/view/GenerateThreadDump

Comment 20 Winston Prakash 2008-01-14 14:40:42 UTC
Please give us more information.

- How much memory available in the machine
- Is Appserver running 
   How many web apps are already running.
   Look at the Server -> Appserver -> glassfish -> web apps
- What is the memory meter reading
   Show memory meter in the toolbar (right click and enable memory meter)

Finally, as petr showed, attach the thread dump 
  
Comment 21 jiai 2008-01-18 17:58:33 UTC
wjprakash:  How much memory available in the machine
     3 GB installed, ~1,7 GB physical memory available

wjprakash: Is Appserver running
     No Appserver is running at the moment
 
wjprakash: How many web apps are already running.
     No WebApp running

wjprakash: What is the memory meter reading
     248,5/367,2 MB (German locale with decimal comma)

Finally, as petr showed, attach the thread dump 
     I'll follow the instructions next time - I believe it would not last long! :-(

The stacktrace is in exception report 20842

Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)
Comment 22 jiai 2008-01-21 14:25:17 UTC
Created attachment 55321 [details]
Threaddump with jstack; Exception 21220
Comment 23 jiai 2008-01-27 13:12:54 UTC
wjprakash:  How much memory available in the machine
     3 GB installed, ~1,9 GB physical memory available; the VM consumes ~786 MB virtual memory

wjprakash: Is Appserver running
     No Appserver is running at the moment
 
wjprakash: How many web apps are already running.
     No WebApp running

wjprakash: What is the memory meter reading
     277/367 MB 

wjprakash: Finally, as petr showed, attach the thread dump 
     Thread dump is attached
Comment 24 jiai 2008-01-27 13:13:45 UTC
Created attachment 55619 [details]
Threaddump
Comment 25 jiai 2008-01-31 17:07:27 UTC
Created attachment 55851 [details]
Threaddump
Comment 26 Winston Prakash 2008-02-01 20:58:58 UTC
Unfortunately, I could not nail any problem from the Thread Dump.
Could you please give more info about your application.
No of pages in the web app?
How many pages are open at the time problem occurs?
What are the actions you were doing when OME occurs?
Did you try increasing the memory (-J-Xmx512m) in the <install-dir>/etc/netbeans.conf dir

Thanks.
Comment 27 jiai 2008-02-09 18:16:58 UTC
Yes, definetly this was the point! I've tested it for more than one week now with a setting of -Xmx900m and
"-J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled". The Java heap space error never appeared again (at least
not in NB 6.01). The problem is the misleading comment in netbeans.conf - for me it implies that Netbeans will acquire a
sufficient amount of heap space for your project automatically:

"Note that a default -Xmx is selected for you automatically."

My proposal for a bugfix is to replace this comment by:

"Note that for some projects (e.g. VisualWeb projects) the default -Xmx, which is selected automatically, is often _not_
sufficient! Try to increase heap space as much as you can. The value is dependend on your operating system and your
physical memory.

As a more elaborated bugfix, the functionality of Netbeans shouldn't depend on archaic editing of a config file with an
editor. Why isn't there a configuration tool for this? A restart after changed settings is acceptable.
Comment 28 Winston Prakash 2008-02-10 05:37:38 UTC
The default -Xmx is set during IDE start by the launch program. 
It believe it sets it at 33% (396M max) of available memory.

Need to have as much as 512M for VisualWeb is not an acceptable 
solution.

We have improved memory consumption in NB 6.1. Hope need for more
memory than what is set by NB as default may not be required for NB 6.1
Comment 29 Lukas Hasik 2008-03-04 12:37:51 UTC
increasing priority. This issue has 268 duplicates - http://statistics.netbeans.org/exceptions/detail.do?id=380
Comment 30 Winston Prakash 2008-03-04 14:28:41 UTC
Lots of performance fix and memory foot print fixes have gone in to NB 6.1. 
Please test against NB 6.1 beta (to be released soon( and let us know how
if OME occurs again.
Comment 31 Winston Prakash 2008-03-20 19:14:23 UTC
Closing this as fixed. Please try NB 6.1
Comment 32 christianferraz 2008-10-04 18:05:57 UTC
Reopening - reproduced in NetBeans IDE 6.1 (Build 200805300101)
Comment 33 christianferraz 2008-10-04 18:09:00 UTC
Reopening - reproduced in NetBeans IDE 6.1 (Build 200805300101)
Comment 34 Marian Mirilovic 2009-03-26 13:55:17 UTC
844 duplicates and still coming !
Comment 35 Sergey Petrov 2009-04-15 10:35:14 UTC
It looks like an issue with report handling, latest reports have nothing with visual web and in real related with
java/editor functionality - scanning or document handling (editor in stack trace).
Comment 36 Sergey Petrov 2009-04-15 10:54:56 UTC
mmirilovic
latest stacktraces have nothing with visualweb, either is are one line "OutOfMemory" or issues are from others areas,
plase reevaluate if necessary. It also may be not P1 ad 870 duplicates may be from different  areas.