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 230493 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.4
Hardware: Macintosh (x86) Mac OS X
: P2 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords: JDK_SPECIFIC
: 239660 242503 242834 243023 243671 245497 250481 252113 254652 254966 255580 256882 262453 267791 271326 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-30 01:07 UTC by nikolaj_a
Modified: 2017-08-18 14:46 UTC (History)
12 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 201024


Attachments
stacktrace (2.25 KB, text/plain)
2013-05-30 01:07 UTC, nikolaj_a
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nikolaj_a 2013-05-30 01:07:36 UTC
Build: NetBeans IDE Dev (Build 201305252300)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_11-b21
OS: Mac OS X

User Comments:
nikolaj_a: Generated a LOT of logging lines from the attached GlassFish 4 caused NetBeans to become unresponsive, run low on memory, and eventuelly run completely out of memory.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
   at java.awt.image.Raster.createPackedRaster(Raster.java:470)
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
   at java.awt.image.BufferedImage.<init>(BufferedImage.java:357)
   at com.apple.laf.AquaPainter$AquaSingleImagePainter.paintFromSingleCachedImage(AquaPainter.java:151)
   at com.apple.laf.AquaPainter$AquaSingleImagePainter.paint(AquaPainter.java:136)
Comment 1 nikolaj_a 2013-05-30 01:07:38 UTC
Created attachment 135107 [details]
stacktrace
Comment 2 Stanislav Aubrecht 2013-05-30 09:12:45 UTC
You've got -XX:MaxPermSize=384m in your netbeans.conf, try removing that option and reopen if still reproducible.
Comment 3 nikolaj_a 2013-05-30 09:24:15 UTC
(In reply to comment #2)
> You've got -XX:MaxPermSize=384m in your netbeans.conf, try removing that option
> and reopen if still reproducible.

I'm running with the completely fresh NetBeans Dev download - no changes in netbeans.conf. There is no MaxPermSize specified, which probably means the OS default.

Even if I specify a higher memory allowance, wouldn't it just postpone the problem? When I mention a lot of logging output, I mean a LOT! Millions of logging entries. It seems that there is no limiting measures taken in the netBeans output window whatsoever.
Comment 4 Stanislav Aubrecht 2013-05-30 09:32:09 UTC
You'll need to adjust the logging level in GlassFish then.
Reassigning to Output component for evaluation. Is there any way to limit the number of lines in Output window?
Comment 5 nikolaj_a 2013-05-30 09:39:50 UTC
(In reply to comment #4)
> You'll need to adjust the logging level in GlassFish then.
> Reassigning to Output component for evaluation. Is there any way to limit the
> number of lines in Output window?

Adjusting the logging level is a good solution, even though in my case everything is actually logged at WARNING level.

How about some sort of "rotation", possibly with a textual reference to the real log files if applicable, or just a hard limit to how many output lines are saved in memory? Just throwing suggestions here :)
Comment 6 Jaroslav Havlin 2013-05-30 14:44:06 UTC
Not sure the OOME is directly related to output window.
Object with biggest retained size is a AquaTabbedPaneContrastUI	(425 MB), that contains field htmlViews with 15762 elements.

Object that contains data for the Output Window (LinesImpl) has size only 2.8 MB, so it's probably not involved in the OOME.

I don't know exactly what the big object is good for. Nikolaj_a, can you see a TabbedPane that contains a lot of tabs?
(Or it could be a memory leak.)

Standa, please, any ideas? Thanks.
Comment 7 Stanislav Aubrecht 2013-05-30 15:25:15 UTC
This is a bug in Aqua L&F implementation in JDK 1.7 - when HTML is being used for JTabbedPane tab titles each update of tab titles creates a new instance of BasicHTML.Renderer class without discarding previous instances for the same tab.

See AquaTabbedPaneCopyFromBasicUI.updateHtmlViews(int) - it was copied from BasicTabbedPaneUI but is missing htmlViews.removeElementAt(index) call from line 3528


It could be a serious performance problem in NetBeans as we use HTML for tab titles in Output window.
Comment 8 nikolaj_a 2013-05-30 21:17:19 UTC
I'm pretty sure I can make a reproducible test case for this. Basically just deploy a simple WAR to the bundled GlassFish 4 with a servlet that starts an infinite loop repeatedly outputting a single log line with WARNING level.
Comment 9 Antonin Nebuzelsky 2013-06-21 14:52:29 UTC
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017284

Closing wontfix on NetBeans side.
Comment 10 Tomas Hurka 2013-12-20 09:25:14 UTC
*** Bug 239660 has been marked as a duplicate of this bug. ***
Comment 11 Stanislav Aubrecht 2014-03-03 09:07:42 UTC
*** Bug 242503 has been marked as a duplicate of this bug. ***
Comment 12 Stanislav Aubrecht 2014-03-21 09:05:09 UTC
*** Bug 243023 has been marked as a duplicate of this bug. ***
Comment 13 Jaroslav Havlin 2014-07-09 11:44:04 UTC
*** Bug 245497 has been marked as a duplicate of this bug. ***
Comment 14 Tomas Hurka 2015-02-18 07:57:01 UTC
*** Bug 250481 has been marked as a duplicate of this bug. ***
Comment 15 Tomas Hurka 2015-04-27 14:10:18 UTC
*** Bug 252113 has been marked as a duplicate of this bug. ***
Comment 16 Milutin Kristofic 2015-07-28 14:28:03 UTC
*** Bug 243671 has been marked as a duplicate of this bug. ***
Comment 17 Jaroslav Havlin 2015-09-04 11:52:18 UTC
*** Bug 254966 has been marked as a duplicate of this bug. ***
Comment 18 Jaroslav Havlin 2015-09-04 15:22:45 UTC
*** Bug 254652 has been marked as a duplicate of this bug. ***
Comment 19 Jan Stola 2015-09-09 13:56:27 UTC
*** Bug 242834 has been marked as a duplicate of this bug. ***
Comment 20 Tomas Hurka 2015-09-27 10:41:03 UTC
*** Bug 255580 has been marked as a duplicate of this bug. ***
Comment 21 Tomas Hurka 2015-12-01 07:36:26 UTC
*** Bug 256882 has been marked as a duplicate of this bug. ***
Comment 22 Tomas Hurka 2016-06-16 12:58:05 UTC
*** Bug 262453 has been marked as a duplicate of this bug. ***
Comment 23 Tomas Hurka 2016-09-02 19:39:35 UTC
*** Bug 267791 has been marked as a duplicate of this bug. ***
Comment 24 Tomas Hurka 2017-08-18 14:46:32 UTC
*** Bug 271326 has been marked as a duplicate of this bug. ***