lz4/lz4-java

liblz4-java*.so files generated in directory other than the one specified by java.io.tmpdir

hlms opened this issue · 3 comments

hlms commented

We are using redisson-3.11.3 in tomcat webapp which has dependency to lz4-java (version 1.4.0) as following:
https://github.com/redisson/redisson/blob/redisson-3.11.3/redisson/src/main/java/org/redisson/codec/LZ4Codec.java

The tomcat\bin\service.bat has -Djava.io.tmpdir=<full path>\tomcat\temp which seems to be getting cleared when the tomcat is restarted.

We observe that lots of (21k+ files occupying 3.2+ GB) liblz4-java*.so files are getting generated in c:\windows\temp (and in c:\Users\<userName>\AppData\Local\Temp in another machine)

  1. Is this due to lz4-java version 1.4.0 and due to the code mentioned above?
  2. Will this be cleaned up if lz4-java version 1.7.1 is used? The commit seems to be clearing files from java.io.tmpdir but in our machine the files are generated in directories other than java.io.tmpdir.
  3. How to identify which code is generating these files?
  4. How to reproduce the issue? Merely using the library does NOT seem to leave the residual files.
  5. What is the ideal way to fix this?
hlms commented

@odaira ,
Request you to take a look.
Posted the question on stackoverflow (https://stackoverflow.com/questions/62588706/liblz4-java-so-files-generated-in-directory-other-than-the-one-specified-by-jav) also as it would be great if someone can quickly guide on this.

Sounds like you observed two issues.

  1. liblz4-java*.so files remained unremoved on Windows: lz4-java 1.7.0 and above include a fix to remove remaining liblz4-java-*.so in the tmp directory on Windows. Could you use the latest lz4-java 1.7.1? Note that you need to manually remove the old liblz4-java*.so files. The fix will only remove newly generated liblz4-java-*.so files.
  2. liblz4-java*.so files were not generated in the directory specified by java.io.tmpdir: I am not aware of this issue. Could you use the latest lz4-java 1.7.1 and see if the problem still exists?
hlms commented

@odaira ,
Updating the library worked though the directory resolution is still a mystery!