view src/alice/test/codesegment/api/PutCodeSegment.java @ 128:9db7fcf98ee9 working

add ApiTest take
author sugi
date Mon, 06 Aug 2012 17:35:45 +0900
parents 117dad267a9b
children
line wrap: on
line source

package alice.test.codesegment.api;

import alice.codesegment.CodeSegment;

public class PutCodeSegment extends CodeSegment{
	
	private static int count = 0;
	
	@Override
	public synchronized void run() {
		
		int[] array = new int[1000];
		for (int i = 0;i< 999; i++)
			array[i] = i;
		
		if (count % 10 == 0)
			System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024 + "MB");
		if (count >= 10000000) {
			System.exit(0);
		}
		ods.put("local", "num", array);
		count++;
		try {
			wait(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		new PutCodeSegment().execute();
	}
	

}