How to use JDK 6 to solve memory issues?
Take care of disk space when you are writing a big program :). Use JDK 6 features:
import java.io.File;
public class DiskSpaceCheck {
public DiskSpaceCheck() {
File file = new File("E:");
System.out.println("E:");
System.out.println("Total: " + file.getTotalSpace());
System.out.println("Free: " + file.getFreeSpace());
System.out.println("Usable: " + file.getUsableSpace());
file = new File("E://movie");
System.out.println("E://movie");
System.out.println("Total: " + file.getTotalSpace());
System.out.println("Free: " + file.getFreeSpace());
System.out.println("Usable: " + file.getUsableSpace());
file = new File("/");
System.out.println("n/");
System.out.println("Total: " + file.getTotalSpace());
System.out.println("Free: " + file.getFreeSpace());
System.out.println("Usable: " + file.getUsableSpace());
}
public static void main(String[] args) {
new DiskSpaceCheck();
}
}
I was actually very suprised that why this feature came so late.











Java,JavaScript,Threading,
Optimization and more with Vaibhav 


