Thanks to Carlos's suggestion, I decided to concentrate my attention on the RAM
At first I enlarged the swap. As explained in this guide, I added a supplementary swap file with the following commands:
so that I had this situation
# dd if=/dev/zero of=/swap_1 bs=1024 count=1000000
# mkswap /swap_1
# swapon /swap_1
...but OpenOffice kept on crashing
~ free -tom
total used free shared buffers cached
Mem: 727 712 14 0 18 168
Swap: 1462 27 1435
Total: 2190 740 1449
# swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 498008 26960 -1
/swap_1 file 999996 0 -2
Anyway, I decided to keep the larger swap file, so I added to /etc/fstab the following line
and I turned my PC off.
/swap_1 swap swap defaults 0 0
Next, I decided to add more physical RAM, so I replaced the 256 MiB module with a 512 MiB one.
I turned the PC on and it finally worked!!
I could suppose that the crash was caused by insufficient physical RAM, but when I replaced back the 256 MiB memory module at the very same place, where it was before, OpenOffice continued working.
The hypothesis is now that the memory module had an imperfect electrical contact, but I still can't understand why it affected only OpenOffice+Java and not other RAM-hungry applications such as Firefox. I can't exclude that after having added the new swap file, I had to reboot the system to properly use the new environment.
I thank you all for your answers.
P.S. I still need to test the validity of the backups of my LAMP server, but I think I'll do it on a sandbox machine, without endangering the real server.