what do you mean it doesn’t not work (.12.2 or the latest 03 LTS)?
You mean you upgraded it and you still have out of memory after a few days? so the memory slowly keeps on growing and you get an out of mem exception in the log ?
those flags (XX) seems fine (if tomcat process can write in that dir)
Else you need to manually trigger a memory dump with the various tools like yourkit or jmap