|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
Memory allocation problem?Hi~ I’m James Kim. Several days ago, I asked a
question, but it wasn’t clear to understand. I’ll describe what the problem is. System : CPU - Pentium 4 OS – Host OS is Windows XP, and I use VMWare. Ubuntu
5.1 is guest OS. Mem – 256M as Ubuntu main memory BenchMark.java source file is like
follow : public class Benchmark{ public
static void main(String args[]){ long
start = System.currentTimeMillis(); long
t1, t2; if(
args.length != 2 ){ System.out.println("usage
: prog_name <mat_size> <iter number>"); return; } else{ System.out.println("args"
+ args.length); } int
mat_size = Integer.parseInt(args[0]); int
iter_num = Integer.parseInt(args[1]); int
mat[][]; System.out.println("test
start"); System.out.println("iteration
: " + iter_num); System.out.println("matrix
size : " + mat_size); System.out.println("====================="); for(
int k = 0 ; k < iter_num ; k++ ){ t1
= System.currentTimeMillis(); mat
= new int[mat_size][mat_size]; System.out.println("mat[][]
is allocated!"); for(
int i = 0 ; i < mat_size ; i++ ){ for(
int j = 0 ; j < mat_size ; j++ ){ mat[i][j]
= i*mat_size + j; System.out.print(mat[i][j]
+ "\t"); } } mat
= null; // System.gc(); t2
= System.currentTimeMillis() - t1; System.out.println("Iteration
: " + k + " Time : " + t2); } System.out.println("====================="); System.out.println("test
finished"); long
end = System.currentTimeMillis() - start; System.out.println("Elapsed
time : " + end); } } The result of “sablevm --property=sablevm.heap.size.max=1000000000
Benchmark 10000 1” is like follow : SableVM version 1.11.3 Copyright (C) 2000-2004 Etienne M.
Gagnon <etienne.gagnon@...> and others. All rights reserved. This software comes with ABSOLUTELY
NO WARRANTY. This is free software, and you are welcome to
redistribute it under certain conditions. To get the name of all copyright
holders and detailed license information, type "sablevm
--license" or look in the directory "/usr/share/sablevm". The SableVM web site is located at
http://www.sablevm.org/ . args2 test start iteration : 1 matrix size : 10000 ===================== The problem is 10000*10000 matrix is
not allocted, and sablevm does not produce any error messages for 3 hours and stopped. If I do test this code at different
environment, it may work well. However I want to know why this
problem is happening. Other VMs like default java and
kaffe work well in same environment. Is it clear what the problem is? I’m afraid of omitting something important
facts…. Thanks~ James. _______________________________________________ SableVM-user mailing list SableVM-user@... http://sablevm.org/lists/control/listinfo/sablevm-user |
| Free Forum Powered by Nabble | Forum Help |