由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 问个java gabarge collection的问题
相关主题
Re: unix环境下如何在java程序中执行命令行?Re: 怎么能是JAVA里的数组开的更大?
Java练习题 2java String
Test your PC speedRe: The real Risk
折腾了一天,实在是绝望了,请教请教.net vs. J2ee(zhuan)
Re: How can I call another program from Java?Java Telnet Client Implementation v0.99Beta
Java runtime?Re: [转载] 如何看某个端口是否被占用?(use UNIX command or ..)
Re: how to initialize corba object orb in servletJAVA RUNTIME.EXEC 一问
说说clone咋违反了类继承的原则来的?question about Jbuilder
相关话题的讨论汇总
话题: isfree话题: wasfree话题: gabarge话题: public话题: gc
进入Java版参与讨论
1 (共1页)
I**A
发帖数: 2345
1
下面的code,run 了gc之后区别还挺大的。。请教大家,gc都free了哪些memory?
thanks!
public class MemTest {
public static void main(String[] args){
Runtime rt = Runtime.getRuntime();
long wasFree, isFree;
isFree = rt.freeMemory();
do{
wasFree = isFree;
System.out.println("before " + isFree ); //here it is 4991136
rt.runFinalization();
rt.gc();
isFree = rt.freeMemory();
System.out.p
m******t
发帖数: 2416
2

Mostly allocated during the two System.out.println calls.

【在 I**A 的大作中提到】
: 下面的code,run 了gc之后区别还挺大的。。请教大家,gc都free了哪些memory?
: thanks!
: public class MemTest {
: public static void main(String[] args){
: Runtime rt = Runtime.getRuntime();
: long wasFree, isFree;
: isFree = rt.freeMemory();
: do{
: wasFree = isFree;
: System.out.println("before " + isFree ); //here it is 4991136

1 (共1页)
进入Java版参与讨论
相关主题
question about JbuilderRe: How can I call another program from Java?
JAVA APPLICATION PATH 一问Java runtime?
Runtime.exec() 问题Re: how to initialize corba object orb in servlet
两个很基本的JAVA问题说说clone咋违反了类继承的原则来的?
Re: unix环境下如何在java程序中执行命令行?Re: 怎么能是JAVA里的数组开的更大?
Java练习题 2java String
Test your PC speedRe: The real Risk
折腾了一天,实在是绝望了,请教请教.net vs. J2ee(zhuan)
相关话题的讨论汇总
话题: isfree话题: wasfree话题: gabarge话题: public话题: gc