aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process
diff options
context:
space:
mode:
authorEric Hartmann <hartmann.eric@gmail.com>2015-02-21 07:28:28 +0100
committerEric Hartmann <hartmann.eric@gmail.com>2015-02-21 07:28:28 +0100
commit5bea5d7c5dfddf7f824977dd8e3bf93faac66be8 (patch)
treed4d9c7979e22d4edab03180256e783f3d9616f0b /server/sonar-process
parent614f659835e0010f70cc8a0c4ccc332e6d06b4aa (diff)
downloadsonarqube-5bea5d7c5dfddf7f824977dd8e3bf93faac66be8.tar.gz
sonarqube-5bea5d7c5dfddf7f824977dd8e3bf93faac66be8.zip
SONAR-6036 Try deleting the memory mapped file at JVM termination
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java
index 0edd51d3456..192f71226cb 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java
@@ -82,7 +82,10 @@ public class ProcessCommands {
}
try {
- sharedMemory = new RandomAccessFile(new File(directory, "sharedmemory"), "rw");
+ File file = new File(directory, "sharedmemory");
+ file.deleteOnExit();
+
+ sharedMemory = new RandomAccessFile(file, "rw");
mappedByteBuffer = sharedMemory.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, MAX_SHARED_MEMORY);
} catch (IOException e) {
throw new IllegalArgumentException("Unable to create shared memory : ", e);