Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application memory issue with mac

I face a problem with java application I built in javaFx. It consumes only 2-3% of cpu usage and around 50 to 80 MB of memory in windows. But in mac same application initially starts with 50 mb of memory and continuously increases to 1 GB and uses over 90% of CPU Usage. I found this information when I checked Mac task manager. When I use a java profiler to find memory leaks, the profiler shows memory usage same like window (not more than 100 MB).

I am confused with this behaviour in Mac.

Has anyone encountered this problem before, or am I doing something wrong with my application?

like image 850
Amit Gupta Avatar asked May 16 '13 12:05

Amit Gupta


1 Answers

Lots of things possible, but i suspect this: Depending on the memory size and cpu count, the jvm may run in server mode, which causes memory management to be different. Use -server option to force it to be server mode always and compare again.

Can also take heap dumps (jmap -dump) to see what is taking up so much memory, and stack traces (kill -3) to see what is taking up so much cpu.

like image 83
handyprogrammer Avatar answered Oct 15 '22 07:10

handyprogrammer