I discovered that in my application i lost FPS due to :
02-27 11:31:05.403: DEBUG/dalvikvm(90): GC freed 1110 objects / 57568 bytes in 216ms
02-27 11:31:34.193: DEBUG/dalvikvm(1423): GC freed 11086 objects / 388256 bytes in 116ms
02-27 11:32:24.702: DEBUG/dalvikvm(1423): GC freed 16590 objects / 556688 bytes in 117ms
02-27 11:33:09.542: DEBUG/dalvikvm(1423): GC freed 16144 objects / 536248 bytes in 114ms
02-27 11:33:46.322: DEBUG/GpsLocationProvider(49): NetworkThread out of wake loop
02-27 11:33:46.322: DEBUG/GpsLocationProvider(49): Requesting time from NTP server pool.ntp.org
02-27 11:33:54.562: DEBUG/dalvikvm(1423): GC freed 15763 objects / 524240 bytes in 121ms
02-27 11:33:56.632: DEBUG/SntpClient(49): request time failed: java.net.SocketTimeoutException: The operation timed out
02-27 11:33:56.632: DEBUG/GpsLocationProvider(49): requestTime failed
02-27 11:33:56.632: DEBUG/GpsLocationProvider(49): NetworkThread wait for 300000ms
i don't know why i have so much of GC freed ..
In first i thought that it is due to so much reallocation memory, but after improving the code. I have still the problem !
i make this code but it is worst :
- Code: Select all
///// drawing //////////////////
// the code to regulate the fps :
countFrame++;
period=System.currentTimeMillis()-start;
start=System.currentTimeMillis();
if( (50-period)>0 )delay=(50-period+delay)/2;
else delay=5;
if(System.currentTimeMillis()-startFrame >= 1000 ) {
FPS=countFrame;
countFrame=0;
startFrame=System.currentTimeMillis();
}
//////////////////////////
class RefreshRunner implements Runnable {
// @Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
demoView.postInvalidate();
try {
Thread.sleep(demoView.delay); // a 10th of a second
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
}
I need help, it is an application which need a lot of calculation and drawing.



. Needs some updating apparently 