I don't think this behavior is normal, but I haven't had a chance to look
into it. If you have a testcase handy that usually makes things quicker for
us - but we should be able to produce one fairly quickly.

In another thread Rick suggested using OpenJPA's
LRS<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_scos_proxy_lrs>support,
have you been able to give that a try?

-mike

On Thu, Aug 4, 2011 at 9:33 AM, Michael Pflueger <michael.pflue...@sma.de>wrote:

> Hi,
>
> I'm reading a huge table with openJPA in chunks, like this:
>
> List list = query.setMaxResults(batchSize).setFirstResult(position *
> batchSize).getResultList();
>
>
> And iterate over it like this:
>
>                for (Entity e : list) {
>                        //entityManager.detach(e);
>                }
>
> Now my Java Heap Space fills slowly up to around close to 100%, then stays
> around that value, sometimes it starts fluctuating...
>
> Now I uncommented entityManager.detach(e), but it behaves more or less the
> same, it fills my whole heap space.
> In small tests I have not gotten an OutOfMemoryException yet, but the
> bigger production app I need this for already got some after some runtime...
>
> I don't really understand this behavior, is there anything I can do about
> it?
> I already tried removing the detached state field from the Entity but that
> does not seem to help either.
>
> What does help is repeatedly calling entityManager.clear() to clear the
> whole context, but this solution might not always be desireable.
>
> So, besides possible solutions I also wonder if this behavior is "normal"
> or whether I should try to create a small testCase for this aswell.
>
>
> Regards,
> Michael
> ___________________________________________________
>
> SMA Solar Technology AG
> Aufsichtsrat: Guenther Cramer (Vorsitzender)
> Vorstand: Juergen Dolle, Roland Grebe, Uwe Hertel, Pierre-Pascal Urbon,
> Marko Werner
> Handelsregister: Amtsgericht Kassel HRB 3972
> Sitz der Gesellschaft: 34266 Niestetal
> USt-ID-Nr. DE 113 08 59 54
> WEEE-Reg.-Nr. DE 95881150
> ___________________________________________________
>
>

Reply via email to