Well, I don't have a solution yet, but I've learned a bit about how to detect memory leaks. I've verified that I do indeed have one. Here are some quick steps for detecting leaks in your Android app:
1) Install the Eclipse Memory Analyzer. You can do this from the "Install New Software..." option in Eclipse.
2) Set up your application in Debug mode.
3) Download your application to your device or emulator.
4) From the DDMS perspective, highlight your app.
5) Click on the "Dump HPROF File" button.
6) After the HPROF viewer comes up, select the Histogram button.
7) In the regex field, enter part of the name of your app to filter things out.
From there you can see how many objects are available. In my case, I have a class that is called Panel. There should be only one instance of this panel present. After performing several orientation changes (landscape <--> portrait), the number of panels ratchets up... once for each change.
So, now it's a matter of figuring out why. What I've done so far is to strip all graphics and graphics threads out of my app. The problem still occurs. Need to spend some more time on this to figure what's not being released and causing this issue. We'll see where this leads....
A blog detailing my experiences with Android as an independent (indie) game & app developer.
Wednesday, April 13, 2011
Memory Leak woes
I was demoing my Slide Rule to a guy at work yesterday and came across a Force Close. It turns out that my app has a memory leak in it. To replicate: go from landscape to portait and back again several times. Eventually, the app will crash because it runs out of memory.
So, over the lunch hour I read up on handling memory leaks and detecting them. Turns out you can use the Heap profile in DDMS. I'll post details after work today. Hopefully I can get this problem cleaned up tonight and return to my libgdx & OpenGL ES studies.
So, over the lunch hour I read up on handling memory leaks and detecting them. Turns out you can use the Heap profile in DDMS. I'll post details after work today. Hopefully I can get this problem cleaned up tonight and return to my libgdx & OpenGL ES studies.
Tuesday, April 12, 2011
Sunday, April 10, 2011
Achievement Unlocked: libgdx Bouncing Sprite
I'm looking at doing development using the libgdx Game Development Framework for Android. It's pretty slick in that you can run things on your desktop before having to worry about deploying them to the target Android device. That, of course, is just the tip of the iceberg... it provides a whole bunch of stuff you need for doing audio, graphics, etc.
I'm running through the initial tutorials and am up to the projection-viewport-camera tutorial, tweaking things as I try things out. I'm thinking it would be a good exercise to port my Slide Rule to utilize libgdx.
Here are a couple of screenshots of my bouncing sprite.

I'm running through the initial tutorials and am up to the projection-viewport-camera tutorial, tweaking things as I try things out. I'm thinking it would be a good exercise to port my Slide Rule to utilize libgdx.
Here are a couple of screenshots of my bouncing sprite.
Saturday, April 9, 2011
Now it's just time to sit back and wait for the accolades
Got my Slide Rule app uploaded to the Android Market. Now all I have to do is sit back and wait for the accolades to come rolling in.
...
(cue: crickets chirping)
...
Anyway, I learned a bunch of stuff and now it's off to working on my next app.
...
(cue: crickets chirping)
...
Anyway, I learned a bunch of stuff and now it's off to working on my next app.
Slide Rule release
I spent a bunch of time last weekend writing a Slide Rule app. Today I'm in the middle of releasing that to the Android Market.
I couldn't sleep last night, so one other thing I did was to update SwiFTP so that it works in full-screen for my Nook Color. I sent an e-mail to the original developer and now have write access to that project. I submitted my updates for that today. Might be interesting to support that and work on issues that people have logged against it.
I couldn't sleep last night, so one other thing I did was to update SwiFTP so that it works in full-screen for my Nook Color. I sent an e-mail to the original developer and now have write access to that project. I submitted my updates for that today. Might be interesting to support that and work on issues that people have logged against it.
Subscribe to:
Posts (Atom)