From 9c38978b20f919e8e2908ffb0daeb84d409517ab Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Tue, 13 Apr 2021 13:30:03 -0700 Subject: [PATCH] fix: memory mapped storage into proper tmpdir location instead of cwd Change-Id: I69dbfa7eacc06fbff492d3918d791b8e0573a422 --- .../eclipse/mat/parser/index/MemoryMappedArraySupport.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/MemoryMappedArraySupport.java b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/MemoryMappedArraySupport.java index 0a966003..014ad59c 100644 --- a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/MemoryMappedArraySupport.java +++ b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/MemoryMappedArraySupport.java @@ -30,9 +30,10 @@ public class MemoryMappedArraySupport { final long sizeOfElement, final Function castFn, final Class clazz) { if (filename == null) { try { - File file = File.createTempFile("mat_memory_mapped_array", null, null); - file.deleteOnExit(); - filename = file.getName(); + File file = File.createTempFile("mat_memory_mapped_array", null); + filename = file.getCanonicalPath(); + // since it's a scratch file, we will clear it on exit + new File(filename).deleteOnExit(); } catch (IOException e) { throw new RuntimeException("could not create temporary array store", e); } -- 2.27.0