caching - How java.uitl.zip.ZipFile caches files in java -
when run following code first time, running 25000ms(i.e. 25 sec) second time onward taking 24ms(i.e. 0.024 sec) closed eclipse , reopen run. till restart machine again, takes 24ms only. article http://www.oracle.com/technetwork/articles/java/compress-1565076.html says java.uitl.zip.zipfile caches. how? caches? how can clear cache?
public class sample { public static void main(string[] args) throws zipexception, ioexception { long st = system.currenttimemillis(); file dir = new file("c:/temp/packages"); file[] files = dir.listfiles(); for(file file : files) { zipfile zfile = new zipfile(file); } long et = system.currenttimemillis(); system.out.println(et - st); } }
close zipfile
using zipfile.close
.
Comments
Post a Comment