Low Memory Warning ANE for Adobe AIR applications on iOS
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Refactored directory structure, Added handling of exception (resolves #2 Nov 17, 2017
build Refactored directory structure, Added handling of exception (resolves #2 Nov 17, 2017
build_config
docs/asdocs
example Refactored directory structure, Added handling of exception (resolves #2 Nov 17, 2017
images
platform
.gitignore Refactored directory structure, Added handling of exception (resolves #2 Nov 17, 2017
CHANGELOG.md Added readme and changelog May 27, 2016
LICENSE
README.md Refactored directory structure, Added handling of exception (resolves #2 Nov 17, 2017
build.xml

README.md

built by distriqt //

Memory

Memory

Memory is an AIR Native Extension to receive the low memory notifications on iOS which indicate when your application should clear up as much memory as possible to avoid facing termination by the operating system.

Features

  • Low Memory Warning Event
  • Memory Information
  • Single API interface - your code works across supported platforms with no modifications
  • Sample project code and ASDocs reference

Documentation

Low Memory Warning

This extension is very simple in the implementation, you simply add a listener for the MemoryEvent.LOW_MEMORY_WARNING and respond accordingly.

if (Memory.isSupported)
{
	Memory.service.addEventListener( MemoryEvent.LOW_MEMORY_WARNING, lowMemoryWarningHandler );
}

Then in your handler you can respond appropriately, clearing any unnecessary memory usage:

private function lowMemoryWarningHandler( event:MemoryEvent ):void
{
	trace( "low memory warning" );
}

Memory Information

You can retrieve some basic information about the current memory statistics using the MemoryInfo class. You retrieve a current version of this by using the getMemoryInfo function:

var info:MemoryInfo = Memory.service.getMemoryInfo();
			
trace( "available memory = " + info.availableMemory );
trace( "total memory     = " + info.totalMemory );

These values are gathered from the operating system directly which should be more accurate representation than the values reported from System.

Native Extensions

The highest quality and widest range of Native Extensions for Adobe AIR

With many native extensions available, we are the largest provider of native extensions for AIR developers. Our mobile solutions allow developers to fast-forward development and focus on building great games and apps.

https://airnativeextensions.com

Acknowledgements

This extension was made possible with support by MovieStarPlanet

MovieStarPlanet