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 209982 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.2
Hardware: All All
: P4 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords: PERFORMANCE
: 238681 244438 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-23 08:22 UTC by naitsirch
Modified: 2016-06-22 09:04 UTC (History)
12 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 186179


Attachments
stacktrace (1.22 KB, text/plain)
2012-03-23 08:22 UTC, naitsirch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naitsirch 2012-03-23 08:22:43 UTC
Build: NetBeans IDE Dev (Build 201203210400)
VM: Java HotSpot(TM) Client VM, 20.6-b01, Java(TM) SE Runtime Environment, 1.6.0_31-b05
OS: Windows 7

User Comments:
naitsirch: I have debugged PHP Code. The Exception occured while str_replace function was executed with a large input string.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:0)
   at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:0)
   at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:0)
   at java.lang.StringBuilder.append(StringBuilder.java:0)
   at org.netbeans.modules.php.dbgp.packets.DbgpMessage.removeNonXMLCharacters(DbgpMessage.java:330)
   at org.netbeans.modules.php.dbgp.packets.DbgpMessage.getNode(DbgpMessage.java:356)
Comment 1 naitsirch 2012-03-23 08:22:46 UTC
Created attachment 117142 [details]
stacktrace
Comment 2 Ondrej Brejla 2012-03-23 08:30:54 UTC
I'm not sure that I'll be able to do something with that. There is a "each character" control, because xdebug is not able (unfortunately, ask Derick Rethans why? :/) to send us only valid XML characters, so we have to check them ourself, separately and build the whole new string from scratch...char by char...that's why StringBuilder is so exhausted...:/
Comment 3 naitsirch 2012-03-26 12:12:03 UTC
Okay, that's a problem...
Maybe you could check memory usage and show just a "friendly" error message to the user ;-)
Comment 4 Ondrej Brejla 2012-04-03 12:45:25 UTC
P4 as a reminder because we can't do anything with that...char by char check has to be done.
Comment 5 Ondrej Brejla 2014-05-30 10:02:35 UTC
*** Bug 244438 has been marked as a duplicate of this bug. ***
Comment 6 Ondrej Brejla 2014-05-30 10:02:45 UTC
*** Bug 238681 has been marked as a duplicate of this bug. ***
Comment 7 naitsirch 2015-05-30 20:26:47 UTC
It is long ago when this bug happened the last time for me. Does it make sense to close it for now?
Comment 8 ajay-whiz 2015-06-02 11:39:28 UTC
 Well in my case it seems this is happened in different scenario, which is described below
 
 1. Open you NetBeans IDE 8.0.2
 2. Leave your system idle for atleast 30-35 Minute
 3. Now open any file in netbeans by using Menu File=>Open File
 4. And now select 15-20 rows and click on 'Tab' key on your computer's keyboard
 5. Your system will hungs up and after a while you'll get this error
Comment 9 Tomas Mysik 2016-06-22 09:04:57 UTC
Please, start NetBeans with increased Xmx parameter.

Thanks.