I start my java with these arguments
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/log/${SERVICE}_`date +%Y-%m-%d:%H:%M:%S`.hprof"
When heap dump occurs, the .hprof
file has -rw-------
(600) permission, which can't be read by other users.
How do I make these files generated with 644
permission?
Attempt:
I tried passing this -XX:+HeapDumpOnOutOfMemoryError="chmod 644 *.hprof"
but got the error:
Improperly specified VM option 'HeapDumpOnOutOfMemoryError=chmod'
What should be the correct syntax? Thank you