How much is too much memory allocation in NDK?

Posted by Maximus on Stack Overflow See other posts from Stack Overflow or by Maximus
Published on 2010-06-14T17:24:08Z Indexed on 2010/06/16 3:22 UTC
Read the original article Hit count: 222

Filed under:
|

The NDK download page notes that, "Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on."

I came from a C background and was excited to try to use the NDK to operate most of my OpenGL ES functions and any native functions related to physics, animation of vertices, etc... I'm finding that I'm relying quite a bit on Native code and wondering if I may be making some mistakes. I've had no trouble with testing at this point, but I'm curious if I may run into problems in the future.

For example, I have game struct defined (somewhat like is seen in the San-Angeles example). I'm loading vertex information for objects dynamically (just what is needed for an active game area) so there's quite a bit of memory allocation happening for vertices, normals, texture coordinates, indices and texture graphic data... just to name the essentials. I'm quite careful about freeing what is allocated between game areas.

Would I be safer setting some caps on array sizes or should I charge bravely forward as I'm going now?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-ndk