…because I seem to like doing it very much.
After hitting a somewhat logical break last week with my project, I felt I needed to do some good bit of refactoring, so I did, and afterwards, I loved how neat and tidy and proper everything was.
Now this weekend, I also hit a logical break, and during one occasion where I had to leave my game running for a while, I came back to discover that my memory was almost all used up. So I frantically searched for how to properly analyze memory leaks in Java and found a nice tutorial that makes use of JVisualVM, which eventually led me to find a texture I was repeatedly loading/creating inside the render() loop that was causing the memory usage buildup :emo:
So anyway… is there anyone here who are compulsive refactorers/optimizers here? And what are the best practices/tips you can share regarding this?
Me, having newly discovered this way to analyze my memory usage, I think I’ll get the urge quite often to optimize the memory usage of my project as much as possible. Although as of now, it seems that I’m barely hitting 90MB memory usage and my biggest memory hog is when I draw all of the sprites I’m using on-screen… which I’m looking at now and can’t see how I can further optimize it to be more efficient.