Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
What Happens When Native Memory Space Pointed By java.nio.ByteBuffer Is Deleted
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="castillo.bryan, post: 643465"] If you try to access it or assign to it you may (probably will) get core dumps. You shouldn't use that ByteBuffer anymore. I had thought about setting the length of a buffer to -1 after freeing it and having all of my code check the length when the ByteBuffer is passed into a JNI function. I never did that though. I ended up wrapping all of my native ByteBuffers in another object I called ManagedBuffer, which had finalize overriden, in case the users of the library forgot to delete resources. (However, I still had issues since each native byte buffer had about 50mb+ of memory. Since that memory was allocated by malloc, that amount of memory didn't trigger the garbage collector as often as I would have liked it to have run.) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
What Happens When Native Memory Space Pointed By java.nio.ByteBuffer Is Deleted
Top