Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

Testing banner

How to monitor inode usage in Java

Arvin.ZJun 11 2016 — edited Jul 19 2016

Hi Experts,

We are facing one issue regarding to Linux inode usage.


Our service (Java-based) is failed to generate new files as the inode usage is 100% on our disk, below Exception thrown up while our service is trying to create a new file.

Exception:

java.io.FileNotFoundException: /home/ftpuser/data/1234.xml (No space left on device)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:671)
        at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:653)
        at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:607)
......

......

Is there any way to monitor inode usage in Java?

What we want is to monitor the inode usage, if the usage is exceed the critical threshold (such as 90%), our service should remove the oldest files.

Any suggestions are really appreciated.

Thanks in advance,

Arvin

Comments
Post Details
Added on Jun 11 2016
1 comment
1,246 views