• Post Reply Bookmark Topic Watch Topic
  • New Topic

usage of memory.  RSS feed

 
Shhailesh Joshi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me why my tiny (303 kb) java program uses large memory(about 200mb) when processing? While other comparitively large programs such as mozilla firefox uses small memory(about 60mb).
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to say without actually seeing the code. I can create an even smaller application that uses even more memory:
The source file is 383 bytes and the class file is 841 bytes. When I run this, the Windows Task Manager shows a usage of 260.156 KB or 254 MB. If I change the 10 million into 100 million memory usage exceeds 1 GB; I can't even run it because I get an OutOfMemoryError, even with -Xmx1500m as a JVM flag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!