Reputation: 3
I'm trying to control where where my heap dumps go on out of memory exceptions using -XX:HeapDumpPath
My java process doesn't have permission to write to the current working directory, so I'm trying to specify the user.home
directory. I can't know the absolute name in advance, so I'm trying to do it using variable like user.home
I tried -XX:HeapDumpPath=${user.home}/mydump.hprof
, but that doesn't work
Is it possible to do this?
Upvotes: 0
Views: 1753
Reputation: 500437
When you run the command you propose, the ${user.home}
gets expanded by your shell before java
is run, and will most likely be blank.
Change ${user.home}
to ${HOME}
.
Upvotes: 1