Ok thanks, I don't know the default java is 32 bits. Should I also change the java stack size ?
edit : I have java 64 bit by default, I don't know how.
That's good news.
I put max memory to 2048 but I can't open my file.
It's already corrupted. Raising the memory now won't fix the problem. Maptool spikes memory usage when you load and save a file. I believe it's when those spikes happen, and they exceed set parameters, that we're most likely to see file corruption.
If you want, please share the broken campaign file here and we can see if it's fixable. It's probably not, but it's not unheard of.
Also, please share your Gather debug text. You get it under Help>Gather Debug Information
I guess I make my dungeon in twoo files now, for security^^
You don't have to do that. Just save the file with a new name after you've played a game or done new work on it so that you have multiple copies of the campaign file should something happen to the latest version.