-XX:+HeapDumpOnOutOfMemoryError 生成内存快照;设置路径:-XX:HeapDumpPath=<path>
-XX:OnOutOfMemoryError ="sh ~/cleanup.sh" 当内存溢出时,执行脚本