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 235649 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on: 232018
Blocks:
  Show dependency tree
 
Reported: 2013-09-08 06:41 UTC by zmirc
Modified: 2013-11-13 17:32 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 203678


Attachments
stacktrace (1.36 KB, text/plain)
2013-09-08 06:41 UTC, zmirc
Details
Error cause (62.75 KB, image/jpeg)
2013-09-09 13:25 UTC, zmirc
Details
bug report. NB failed to upload it (79.07 KB, application/octet-stream)
2013-09-09 13:34 UTC, zmirc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zmirc 2013-09-08 06:41:01 UTC
Build: NetBeans IDE 7.4 Beta (Build 201307092200)
VM: Java HotSpot(TM) Client VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 8

User Comments:
zmirc: It shouldn't have happened because I didn't use it so much.
It might be something wrong with how 7.4 Beta handles JavaFX projects, because I couldn't run them from NetBeans. I had to build them, then execute them outside NB.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOfRange(Arrays.java:2694)
   at java.lang.String.<init>(String.java:203)
   at java.lang.String.substring(String.java:1913)
   at java.lang.Class.checkMemberAccess(Class.java:2183)
   at java.lang.Class.getDeclaredFields(Class.java:1761)
   at com.sun.jna.Structure.getFields(Structure.java:769)
Comment 1 zmirc 2013-09-08 06:41:03 UTC
Created attachment 139797 [details]
stacktrace
Comment 2 zmirc 2013-09-08 06:44:24 UTC
Actually, it happened again a few minutes after.
I was trying to invoke auto completion for JPQL in a @NamedQuery query section, but NetBeans took 100% of one CPU, frozen and increased the memory footprint very very much.
I had to kill the process in order to make it work.
Comment 3 Jaroslav Havlin 2013-09-09 10:51:05 UTC
There are almost 4 million instances of 
org.eclipse.persistence.jpa.jpql.parser.OrderByItem and of
org.eclipse.persistence.jpa.jpql.parser.AbstractExpression$Info.

I'm not sure whether it can be related to javaee/Persistence,
or to a 3rdparty plugin.
Reassigning. Sergey, please evaluate. Thank you.
Comment 4 Sergey Petrov 2013-09-09 10:55:41 UTC
these classes are from external "plugin", but it may be related to persistence in case if resources are not released properly.
Comment 5 Sergey Petrov 2013-09-09 10:57:24 UTC
Jaroslav, do you have memory dump or can reproduce it easily?
Comment 6 Jaroslav Havlin 2013-09-09 11:01:49 UTC
(In reply to Sergey Petrov from comment #5)
> Jaroslav, do you have memory dump or can reproduce it easily?
I've used the memory dump provided by Exceptions Reporter:
 - Exception Reporter link in this page -> link 690418 -> Heap Dump(gzipped)
Comment 7 Sergey Petrov 2013-09-09 11:44:39 UTC
thanks.

is initial problem appears only if try to execute first?

also I tried javafx with about 20 entities, and there is nothing special, it may be related to some specific entities model or specific jpql constructs, may be thousands  of entities or extra long/complex jpql?
Comment 8 zmirc 2013-09-09 13:25:06 UTC
Created attachment 139837 [details]
Error cause

I have figured out how to reproduce it. If you take a look at the image, I wrote ORDER in a JPQL query that did already have ORDER BY. After that I've invoked the auto completion (ctrl + space). That's it. NetBeans froze and tried to show the pop-up window "Unexpected Exception" after 1 minute, but I couldn't even use it because it froze again when I switched from browser to NB.
I'll try to do it again and report it, so maybe it will contain more info.
Comment 9 zmirc 2013-09-09 13:30:31 UTC
Because I was in another app between NB froze and the moment when it tried to show that pop-up, I couldn't report that one. The interesting part is that, after 1 more minute, that pop-up started to appear/disappear, then NB started to do the same.
I have 1 CPU blocked on NB and it's taking RAM continuously.
I finally had to kill NB. When I started it back, NB showed a pop-up asking to report a failure, and that's what I'm doing now. It should appear soon.
Comment 10 zmirc 2013-09-09 13:34:19 UTC
Created attachment 139838 [details]
bug report. NB failed to upload it

I got the following message while NB was trying to upload the report:
"Upload of log failed, please report the original problem directly at ...(a link) and attach messages.log file.
The messages.log file is located at
xxxxx"
This is the file.
Comment 11 Sergey Petrov 2013-09-10 05:55:16 UTC
thanks, easily reproducible with "SELECT d FROM DiscountCode d ORDER BY d.rate ORDER"
Comment 12 Sergey Petrov 2013-09-10 12:02:44 UTC
initial evaluation point to eclipselink issue, I hope will be able to update eclipsleink to 2.5.1 in 7.4 patch(and hope it will be fixed soon), set to P2, unfortunately it's a bit later for 7.4
Comment 13 PascalFilion 2013-09-10 16:47:58 UTC
I have filed an EclipseLink bug for the issue, the fix will be part of the 2.5.1 patch release.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=416941
Comment 14 Sergey Petrov 2013-10-01 16:38:40 UTC
http://hg.netbeans.org/web-main/rev/2503cb719727 2.5.1
Comment 15 Sergey Petrov 2013-11-13 17:32:31 UTC
graft - http://hg.netbeans.org/releases/rev/fee70e933219
(include spec versions update)

long desc http://hg.netbeans.org/releases/rev/e29c4926b6b9