Who recovers the memory?

satya - Tuesday, June 30, 2009 10:48:40 AM

who releases opengl buffers?

who releases opengl buffers?

Search Google for: who releases opengl buffers?

Search Android Developers Group for: who releases opengl buffers?

Search Android Beginers Group for: who releases opengl buffers?

Search Google Code for: who releases opengl buffers?

Search Android Issues Database for: who releases opengl buffers?

satya - Tuesday, June 30, 2009 10:52:46 AM

A nice topic on glbegin and glend

A nice topic on glbegin and glend

satya - Tuesday, June 30, 2009 10:54:52 AM

why not glbegin and glend?

In addition, glBegin()/glEnd() style code creates a lot of function call overhead because you call a separate function for every vertex, color, texture coordinate, and normal. This overhead is non-trivial for objects with a lot of data.

satya - Tuesday, June 30, 2009 10:57:53 AM

VBOs: vertex buffer objects

VBOs: vertex buffer objects. These are introduced in opengl 1.5

satya - Tuesday, June 30, 2009 11:02:53 AM

release opengl memory in android

release opengl memory in android

Search Google for: release opengl memory in android

Search Android Developers Group for: release opengl memory in android

Search Android Beginers Group for: release opengl memory in android

Search Google Code for: release opengl memory in android

Search Android Issues Database for: release opengl memory in android

satya - Tuesday, June 30, 2009 11:08:05 AM

Read this thread

Read this thread

satya - Tuesday, June 30, 2009 11:09:54 AM

who frees cleanup allocate memory opengl buffers?

Search for: who frees cleanup allocate memory opengl buffers?

satya - Tuesday, June 30, 2009 11:10:29 AM

java nio bytebuffer

java nio bytebuffer

Search Google for: java nio bytebuffer

Search Android Developers Group for: java nio bytebuffer

Search Android Beginers Group for: java nio bytebuffer

Search Google Code for: java nio bytebuffer

Search Android Issues Database for: java nio bytebuffer

satya - Wednesday, July 01, 2009 9:10:05 AM

Looks like nio can take care of garbage collection. read this

Looks like nio can take care of garbage collection. read this

satya - Wednesday, July 01, 2009 9:14:39 AM

what are java nio direct buffers

Search for: what are java nio direct buffers

satya - Wednesday, July 01, 2009 9:14:55 AM

read a little bit about direct buffers here

read a little bit about direct buffers here

satya - Wednesday, July 01, 2009 9:18:38 AM

An interesting read about JVM memmory management: pdf file

An interesting read about JVM memmory management: pdf file

satya - Wednesday, July 01, 2009 9:35:43 AM

Another nice article from ibm on memory management

Another nice article from ibm on memory management

satya - Wednesday, July 01, 2009 9:51:20 AM

Bottom line about nio buffers

The java.nio package is there to allocate memory space outside of the java heap that can be directly used by such systems as OpenGL or file i/o etc.

One question arises when the "allocateDirect" method is called to allocate memory for a native buffer. who is going to clean up this native allocation? Should I call some kind of a "deallocate"? There is no such function.

This is because, the nio buffers are actually java objects that eventually point to the native buffer. These objects are garbage collected. When they are garbage collected they go ahead and delete the native memory. Java programs doesn't have to do anything special to unallocate or free the memory.

However the "gc" won't get fired unless there is memory needed in the java heap. This means you can run out of native memory and gc may not realize it.

One implementation in the references above points to an approach where an outof memory exception will trigger a "gc" and tries it again.

Importantly for the sake of OpenGL under ordinary circumstances one can allocate the native buffers and not worry about releasing explicitly as that is done by the gc.