Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Memory leak/control overhead(The database fetch object data is 4 times bigger then object born one)
Memory leak/control overhead [message #685981] Tue, 21 June 2011 09:01 Go to next message
Sven Klemm is currently offline Sven KlemmFriend
Messages: 11
Registered: June 2011
Junior Member
- runtime args: -Xmx1024M -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=1
- Payload send from database: about 35 MB (because its an ANSI stream) on IPStack
- Raw entity object payload in memory should be ~100 MB (UTF-8 String, Date-Object, List References)
- Object memory consumption ~650 MB (fetched from DB)
- Object memory consumption ~200 MB (born on client+added to persistence context)

- Why are the memory consumption such that high?
- I tried
* static weaving: no benefit for that use case
* @ReadOnly-Annotation: no benefit for that use case

  • Attachment: testcase.txt
    (Size: 14.35KB, Downloaded 387 times)

[Updated on: Tue, 21 June 2011 09:06]

Report message to a moderator

Re: Memory leak/control overhead [message #686209 is a reply to message #685981] Tue, 21 June 2011 20:31 Go to previous messageGo to next message
Frank Schwarz is currently offline Frank SchwarzFriend
Messages: 26
Registered: July 2009
Location: Dresden
Junior Member
What happens if you replace
m.setEmail("sk @ somewhere.de");

with
m.setEmail(new String("sk @ somewhere.de".toCharArray()));

just to bypass the JVM's string literal pool?

-- Frank
Re: Memory leak/control overhead [message #686398 is a reply to message #686209] Wed, 22 June 2011 07:15 Go to previous message
Sven Klemm is currently offline Sven KlemmFriend
Messages: 11
Registered: June 2011
Junior Member
Wed Jun 22 09:07:07 CEST 2011 662 Before GetResult - here everything is fine java allocates about 15 MB in memory[15]
Wed Jun 22 09:07:27 CEST 2011 100 ArraySize: 1000000 - 1,000,000 objects fetched from database take about 700 MB - 800 GB in memory[679]
Wed Jun 22 09:07:28 CEST 2011 705 List copied[679]
Wed Jun 22 09:07:29 CEST 2011 712 Wait 0 done[679]
Wed Jun 22 09:07:31 CEST 2011 721 Wait 1 done[679]
Wed Jun 22 09:07:33 CEST 2011 726 Wait 2 done[679]
Wed Jun 22 09:07:35 CEST 2011 415 Wait 3 done[676]
Wed Jun 22 09:07:37 CEST 2011 115 Wait 4 done[666]
Wed Jun 22 09:07:37 CEST 2011 781 Memory consumption will only descrease a little bit (~650 MB), because newList hold all entity object references with all jpa control overhead[652]
Wed Jun 22 09:07:37 CEST 2011 782 ArraySize: 1000000[652]
Wed Jun 22 09:07:38 CEST 2011 788 Wait 0 done[652]
Wed Jun 22 09:07:39 CEST 2011 990 Wait 1 done[49]
Wed Jun 22 09:07:41 CEST 2011 25 Wait 2 done[49]
Wed Jun 22 09:07:42 CEST 2011 63 Wait 3 done[23]
Wed Jun 22 09:07:43 CEST 2011 97 Wait 4 done[23]
Wed Jun 22 09:07:43 CEST 2011 142 Now all entity object references are cleared and so this raw payload and the jpa control payload is deallocated from memory ~ 20-50 MB remains in memory[23]
Wed Jun 22 09:07:43 CEST 2011 143 Before creating[23]
Wed Jun 22 09:07:49 CEST 2011 904 After creating, there are round about 150 MB memory consumption - the raw payload[468]
Wed Jun 22 09:07:58 CEST 2011 794 After adding to Persistence Context it explode to 900 MB[799]
Wed Jun 22 09:07:59 CEST 2011 795 Wait 0 done[799]
Wed Jun 22 09:08:01 CEST 2011 534 Wait 1 done[799]
Wed Jun 22 09:08:03 CEST 2011 213 Wait 2 done[783]
Wed Jun 22 09:08:04 CEST 2011 933 Wait 3 done[727]
Wed Jun 22 09:08:06 CEST 2011 677 Wait 4 done[613]
Wed Jun 22 09:08:07 CEST 2011 359 After garbage collection it is reduce to a normal and explainable 200 MB - 250 MB memory consumption ==> this is a acceptable memory consumption[613]
Wed Jun 22 09:08:07 CEST 2011 359 ArraySize: 1000000[613]

thx@frank
the "bug" was in the comparison...

but now i worry about the object memory consumption of java itself Sad

[Updated on: Wed, 22 June 2011 07:31]

Report message to a moderator

Previous Topic:(no subject)
Next Topic:OptimisticLockException
Goto Forum:
  


Current Time: Fri Apr 26 03:16:55 GMT 2024

Powered by FUDForum. Page generated in 0.03184 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top