I'm new to profiling java applications and I was uncertain when I saw my small application could take up to 800MB memory twice as much as the whole operating system and around 450MB after some user interaction.
So I've red some articles about how memory allocation and gc work and it seems the JVM takes all it can get and that most times it's not necessary to have that much memory for your application to run.
So I tested how much I can limit the heap without crashing my application and stopped testing at -Xmx32MB.
I was suprised that there was no recognizeable performance loss beside the fact the application uses nearly 30 times fewer memory.
So now I'm wondering...
(1) ... if there are any downsites of limiting the heap?
(2) ... if it's common the limit the heap or if it's recommandable to let the JVW decide how much memory it needs and want to use?
(3) ... what's the best way to find out what's the minimum memory size your application needs to run? (I'm just interested)
(4) ... should I experience performance losses when limiting the heap?
Thank you in advance!