OK, some results. Firstly, I am somewhat surprised to find that my (testing) VMs don't have a swap partition, instead depending on a /swapfile. Thats poor IMHO, dedicated partions were once considered the only worthwhile way to swap. But I just realized that my host machine is setup the same way. The host has 16G ram and a 1.4G swapfile, that also offends the old sysadmin in me. Sigh.
Now, my results may not be directly related to the original question asker because my test machine is a VM but it sure is worth looking into.
'swapiness', its a measure of when, as we run out of ram, the system starts using swap. Ubuntu's default is apparently 60, it will use swap when 60 of ram is left. Now, my VMs get 4G ram, that 'should' be heaps (if you forgive the pun) so, I will set swappiness to 20 instead.
sudo sysctl vm.swappiness=20 <enter>
Note, that won't stick around after a boot. First two starts of Lazarus resulted in a lockup that required a reboot. So, I increased the swapfile size to 2G, See
https://askubuntu.com/questions/927854/how-do-i-increase-the-size-of-swapfile-without-removing-it-in-the-terminalLike this, I repeatably started Lazarus and closed without saving config 11 out of 15 times. Four times I experienced a delay of maybe 30 seconds and then either things resumed eventually, maybe a dialog would pop up saying Lazarus was not responding and sometimes it needed a reset.
During these bad starts, the VM's cpu might go to 100%, gnome-shell was often reported to be using most of that.
The extra swap space and lower swappiness certainly helped but did not solve the problem !
Similar results running Ubuntu on Wayland and even Mate (but no so many tests done). Seems clear its a Ubuntu 1910 problem, not just Ubuntu Gnome.
Davo