Skip to content

PApplet fragments remain in memory even after parent activity has been destroyed #217

Closed
@jsalerno

Description

@jsalerno

A fix in #213 solved the issue of Activity refs being retained by PApplet fragments. That solves a major part of memory loss/leakage. Those activity's PApplet fragments, however, are themselves retained in memory even after the Activity instances are gone from the Heap.

Here is a sample reference tree of such a fragment ref still on the heap:

mypkg.MyTroublesomeProcessingFragment@317856864 (0x12f21c60)
    java.lang.Thread@318656032 (0x12fe4e20)
    processing.opengl.PGraphics3D@343302144 (0x14766000)
    processing.core.PApplet$SketchSurfaceViewGL@316919808 (0x12e3d000)
    processing.core.PApplet$InternalEventQueue@345443392 (0x14970c40)
    mypkg.MyTroublesomeProcessingFragment$CurrentTrace@314993488 (0x12c66b50)
    processing.opengl.PGLES@314815264 (0x12c3b320)
    processing.opengl.PShader@315869120 (0x12d3c7c0)
    processing.opengl.PShader@315868880 (0x12d3c6d0)
    processing.opengl.PShader@315867920 (0x12d3c310)
    processing.core.PImage@314746992 (0x12c2a870)
    java.lang.Object[12]@346065984 (0x14a08c40)

mypkg.MyTroublesomeProcessingFragment extends PApplet.

It looks like the PImage is still in memory and through the object tree the reference is retained.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions