nweber / SystemVolumeNativeExtension

An AIR native extension to interact with the system volume for iOS and Android devices.
55 stars 32 forks source link

Extreme memory comsumption issues - app crashing. SDK 4.0 #5

Closed eric-holmes closed 10 years ago

eric-holmes commented 10 years ago

Hi there,

I've created a playground app to test some ANE's, and one of them is yours.

I have 2 simple buttons - increase/decrease volume.

    public function increaseVolume( value:Number = .1 ):void {
        if (soundEx) {
            trace('free '+System.freeMemory);
            soundEx.setVolume(0.75);
        }
    }

    public function decreaseVolume( value:Number = .1 ):void {
        if (soundEx) {
            trace('free '+System.freeMemory);
            soundEx.setVolume(.25);
        }
    }

I am tracing out the System.freeMemory, and it is jumping quite a bit when clicking on either button, latest trace was:

61440 (startup) increase - 32768 increase - 32768 decrease - 12288 (clicked decrease again - app crash).

This seems like a large amount of memory to be allocated for such a simple setVolume call. Any ideas what may be causing this?

I am testing on the newest generation of iPod.

eric-holmes commented 10 years ago

Also refactored the if statements to use a simple boolean for the check, rather than checking the SoundExtension object each time. I gained a little bit of memory, but still after 3-4 times of "Volume Up" we crash.

69632 (startup)
36864 (increase)
16384 (increase)
16384 (increase)
16384 (increase)
(increase again - crash)
eric-holmes commented 10 years ago

Voiding this issue - it seems I had an older version, I was handed the ANE asset - should have just downloaded it!