Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

memory question?

 
zhao xin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if java get memory from OS, it don't return to OS until the programe end ?
How to down totalmemory of java ?
 
Susilo Saja
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zhao Xin,
There are some methods in class Runtime about this.
Susilo
 
zhao xin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
my question is down java totalmemory(no freememory)?
In my program ,i use manay memory . the java totalmemory raise very big .When i use System.gc(),the java freememory is down,but java totalmemory is not down.The OS memory is old OS memory add java totalmemory .
How to down java totalmemory? This can down OS memory.
Thanks
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zhao,
When the JVM is launched, the host operating system allocates an amount of memory to it. I understand that you want to change this amount of memory, from within the JVM, while it is running.
If this is the case, I don't think it can be done in pure java. You would most probably have to do this via JNI and the host operating system services.
While researching a similar topic, I found that your question has been asked several times already in the various java forums and newsgroups, but I failed to find an adequate response. Therefore, there's not much more I can offer you, sorry :-(
Hope this has helped you, anyway.
Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic