Frage

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?

War es hilfreich?

Lösung

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}.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top