Slightly better than saving memory would be to have the program save your work for you.
First obtain the pid (process ID) of the running program. This can be done from a command line with the ps
command:
$ ps x
PID TTY STAT TIME COMMAND
(... lots of usual programs omitted)
3039 ? Sl 40:59 /usr/lib/someprogram
...
30263 pts/8 R+ 0:00 ps x
Let's say I wanted to trigger someprogram
to clean up and save the files, assuming it is a professional grade program (try each in sequence until one works):
$ kill -HUP 3039 # trigger the program's "terminal disconnect by hang up"
# logic (which might save the file)
$ kill -INT 3039 # Interrupt
$ kill -STOP 3039 # Stop
$ kill -CONT 3039 # Continue
A more-grasping-at-straws approach would be to have the program's memory written to a core file. Then at least, someone familiar with the internals of MyPaint could load it into the debugger and reconstruct the data for subsequent use. This is "hard" though and will involve hours to days of expert attention.
To dump core, try these. Core dumps might not be enabled in your system's configuration.
$ kill -ABRT 3039 # abort
$ kill -QUIT 3039 # quit
$ kill -SEGV 3039 # illegal memory access
$ kill -TRAP 3039