Native allocation accounting
Added two new functions: registerNativeAllocation and registerNativeFree. These functions should be used to let the GC know about native allocations which are held live by Java objects and released in finalizers. GC are performed or requested from within registerNativeAllocation when the total number of native bytes accounted for exceeds a certain threshold. After a GC occurs in registerNativeAllocation, finalizers are run so that the native memory is freed. Added a test which shows how to use these functions. Change-Id: I40f3c79e1c02d5008dec7d58d61c5bb97ec2fc1b
Loading
Please sign in to comment