Skip to content
DaanVanYperen edited this page Dec 27, 2014 · 21 revisions

Automatically rewrite components so that instances are recycled.

When to use this

This feature helps mitigate garbage collection related freezes and stuttering on the Android platform.

Prerequisites

Processing of @PooledWeaver annotated components is done by the maven plugin or by running the Command Line Tool.

Minimal example

###What you type:

@PooledWeaver
public class ExampleComponent extends Component {
    public float x;
    public float y;
    public String someObject;
}

###What the JVM gets:

public class ExampleComponent extends PooledComponent {
    public float x;
    public float y;
    public String someObject;
    
    protected void reset() {
        x = 0;
        y = 0;
        // non-primitive types are left intact (someObject)
    }
}
Clone this wiki locally