openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Keays <>
Subject cached byte[] consumes excessive memory
Date Tue, 31 Oct 2006 00:28:00 GMT
Hi all,

I am experimenting with serving blobs from a database with JPA and have 
noticed that, when caching is enabled, OpenJPA uses significantly more 
memory than you would expect to cache the blob. For example, a 7MB 
byte[] consumes over 120MB of memory when cached.

My profiler shows me that this memory is being consumed by 1 or 2 very 
large Object[] s created by the ArrayList used to cache the byte[] in 
org.apache.openjpa.kernel.AbstractPCData.toData(). I can't see anything 
obviously wrong with the code there and the value of the length variable 
seems to be correct.

Perhaps somebody else might know what is going on here? The stacktrace 
which produced this memory blowout is attached as a .png.



Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message