bisq/common/src
Steven Barclay 80ac646d2b
Reuse temp file names to fix a memory leak caused by deleteOnExit()
The internal 'java.io.DeleteOnExitHook' uses a LinkedHashSet of paths to
to delete files at when the JVM exits. However, since there is no way to
remove entries from the set, it leaks memory when calling deleteOnExit()
for every new temp file created by FileManager.saveToFile. To avoid
this, try to reuse file names (using one per FileManager instance).

(FileManager.saveToFile appears to be called on average around every 2s,
and this probably leaks around 36 + length * 2 bytes for the String
object, 36 bytes for the hashtable node and maybe around 10 bytes for
the table entry, or 82 + length * 2 ~= 236 bytes for a typical temp file
path length on Windows - about 10MB per day.)
2019-12-20 23:29:06 +00:00
..
main Reuse temp file names to fix a memory leak caused by deleteOnExit() 2019-12-20 23:29:06 +00:00
test/java/bisq/common Remove unused Utilities 2019-10-09 18:40:13 +02:00