7
4
I have java(yeah java...) application running on CentOS 7. After a while, there are many "deleted" files that bother me.
for deleted files used(not the issue):
lsof | grep "(deleted)"
I found them in /proc/pid/fd/... and my question is how can I kill/delete them without killing the process(process have to run 24/7).
I saw on google that I can use gdb tool, but I don't know how to use it. Can you please help me(just to write step-by-step manual)?
I will love to hear some other suggestions if you have.
@user20574 If another program was writing to the file, and it lost the handle to it, it's obvious that would cause a file corruption. – Glimpse – 2018-07-27T00:05:07.567
@Glimpse well yes, but only to the file you force-closed. It's not obvious that it will also corrupt other files at random. – user253751 – 2018-07-27T02:14:57.997
I am more curious about how to NOT make this happen in the first place. That is to ask: how to delete files properly in Java so they don't end up appearing as "deleted" but "open" files that you need to "clean up" separately. – jyu – 2019-11-06T23:32:39.030