Skip to content

Instantly share code, notes, and snippets.

@falkolab
Last active September 22, 2015 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falkolab/3fb88117de8046ac1f91 to your computer and use it in GitHub Desktop.
Save falkolab/3fb88117de8046ac1f91 to your computer and use it in GitHub Desktop.
Memory leak test case for Titanium SDK
function doClick(e) {
Alloy.createController("test").getView().open();
}
$.index.open();
<Alloy>
<Window class="container">
<Button onClick="doClick">Open test window</Button>
</Window>
</Alloy>
<Alloy>
<Window>
<Label>Simple test window</Label>
</Window>
</Alloy>
@falkolab
Copy link
Author

  1. Run app on device (Monitoring allocations on Android).
  2. Press GC.
  3. Create HPROF dump
  4. Open and then close test window
  5. Press GC once or twice
  6. Create second HPROF dump
  7. In second dump create histogram and press "Compare to another Heap Dump"

My result for Ti SDK 5.0.0.GA:

dump diff - MAT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment