You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data for the "Free disk space" graph is based on the value of getFreeSpace(). (See JavaInformations.java.) At least on Linux/Unix this value includes both the free space for block usage and for inodes. In practice, you will almost certainly run out of block usage first, and have a lot of inode space left over that you can't use.
For example, javamelody is currently telling me that I have 22 G of disk space free. But the output of df tells me that I only have 15 G free; the other 7 G is certainly "free", but it is allocated for inodes.
The getUsableSpace() method does return 15 G in my case. Test program:
import java.io.File;
public class freespace {
public static void main(String[] args) {
File file = new File(".");
System.out.println("getFreeSpace: " + file.getFreeSpace());
System.out.println("getUsableSpace: " + file.getUsableSpace());
}
}
The data for the "Free disk space" graph is based on the value of
getFreeSpace()
. (SeeJavaInformations.java
.) At least on Linux/Unix this value includes both the free space for block usage and for inodes. In practice, you will almost certainly run out of block usage first, and have a lot of inode space left over that you can't use.For example, javamelody is currently telling me that I have 22 G of disk space free. But the output of
df
tells me that I only have 15 G free; the other 7 G is certainly "free", but it is allocated for inodes.The getUsableSpace() method does return 15 G in my case. Test program:
Output:
So, would it be possible to have the value of
getUsableSpace()
recorded and graphed, either as well as, or instead of,getFreeSpace()
?The text was updated successfully, but these errors were encountered: