jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes memory question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "memory question?" Watch "memory question?" New topic

memory question?

zhao xin

Joined: Jan 19, 2003
Posts: 3
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

Joined: May 27, 2003
Posts: 91
Hi Zhao Xin,
There are some methods in class Runtime about this.
zhao xin

Joined: Jan 19, 2003
Posts: 3
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.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

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,
I agree. Here's the link: http://aspose.com/file-tools
subject: memory question?
It's not a secret anymore!