Farm Nightmare - A pixel rpg horror

Care to elaborate?
What information should I provide?

Use tools like Java VisualVM to profile various statistics on your application.

It will help isolate memory leaks, cpu bottlenecks and such. It will be good to learn how to analyze these and what you can do to remedy problems.

Alright, I’ll have a look-c

edit:
Here’s what I’ve gathered from the memory profiler.
Any idea why byte[] is so large?
Looks like I may dump the Rectangles and just use values for collision detection

http://flashpawstudios.com/wp-content/uploads/2016/08/memoryProfiler.png

the cpu is bogged down because I’m using RadialGradientPaint + fillRect() to create the light effect.

though I’m not getting any GC activity. How do I call it?

Okay so I made a transparent image (png) and am drawing that on top to get a light effect instead of using RadialGradiantPaint and what a difference!

I’m also periodically making a call to System.gc() in my game loop though its activity is minimal. I’m thinking the stuff I want to dump isn’t actually being collected.

How can I set things to be picked up by the gc?

edit:

found this and that

Byte[] is likely the textures loaded in to memory.
Drawing calculations vs drawing a prendered texture is basically trading memory space for less cpu power.

This old laptop seems to like the transparent image more, I think I’ll stick with it

Cannot dump one screen, switch to another, and have the GC clear up the heap. :’(

If anyone has a good example to show please let me know.

You have to look at what is using your memory before looking at what needs to be cleaned up.
Find whether or not if any of that used memory is necessary. You can avoid using the gc by avoiding any unnecessary memory usage in the first place.

You might not even have to be concerned about memory management at the moment anyway.

A big chunk of it is the audio stream for the looping clip. The audio file is like half the size of the app. I’m thinking I’ll load it up into an audio software and compress it a bit more.

The others are BufferedImages and those are specific to the area in the game world. I ran my title screen and it’s less than 30MB though when I switch from it to the game screen it stacks on top of all the tiles and audio.

Eventually I’ll be switching around to different areas in the game which will require separate spritesheets so this problem is in the back of my head for now. But yeah, I’m thinking I’ll keep going along for now not worrying about it.

In the meantime I’ve created a post over in the newbie forum

Hey! I just noticed your reply.

If you need some free sounds, here’s where I always get mine if I need them ASAP:
http://www.freesfx.co.uk/

Keep in mind they’ll likely need balanced, but all of these are free and you can use them for your projects.

@SkyAphid

Sweet! Never seen this one before