QEMU Guest - Ubuntu 22.04 Desktop / Gnome / Eclipse Broken

Like many I recently move quite a few machines to Ubuntu 22.04, including a couple of development VMs that are using the Ubuntu Eclipse (IDE - Integrated Development Environment).

As someone who likes "simple", I have used the built in Ubuntu Eclipse "snap" to get my Eclipse machines up and running (what can be simple than typing' "sudo snap install --classic eclipse" ?

The upgrade process from Ubuntu 20.04 LTS to 22.o4 LTS automatically does refresh/update of these Eclipse environemts. However this new 22.04 Eclipse snap renders the enviroment unusable. The reason is that the performance is so slow and unresponsive that it is almost imposible to develop software productively, as I was always waiting for cursor to return or key strokes to complete.

So is it a "Hopeless Case" snapped branch??

Tree Recovery For Homeowners - Hopeless Case

I have the same problem across 3 Eclipse IDE VMs, so this is a problem that repeats. So do I abandon Eclipse and move my development to "VS Code" or get rid of snap Eclipse and move to Eclipse Installer based setup ?

Having briefly tried "VS Code" and found this was a big step in learning a new environment, I decided it would be simpler to go to Eclipse Installer based setup.

Here are my notes on the change from "snap based Eclipse" to "Eclipse Installer based" setup.


Step 0 - My configuration

I am running Eclipse in Ubuntu 22.04 QEMU Virtual Machine guests in Ubuntu 22.04 KVM Host.

Host #1:

  • Lenovo Server
  • Dual 16 Core CPUs (with hyperthreading == 64 CPUS)
  • 384GB RAM
  • Ubuntu 22.04
  • Libvirt 8.0.0
  • QEMU API 8.0.0
  • Hypervisor QEMU 6.2.0

The Ubuntu 22.04 Geust VM's configuration:

  • Q35 VM with OVMF
  • 4 x CPU
  • 8192MB RAM
  • Ubuntu 22.04 OS

The Ubuntu 20.04 Geust VM's configuration:

  • Q35 VM with OVMF
  • 2 x CPU
  • 4096MB RAM
  • Ubuntu 20.04 OS

Step 1 - Record you plugins

The first step was to prepare by doing an "About Eclipse" and getting the enviornment details. This is so I can ensure that once I move to Installer Eclipse setup I can reload the various pluggin.

In one of projects I am using: Java + Antlr and in another I am using Java, Thifit, python and go. Each of these has distinct set of of plugins installed.

I took a screen shot of the information for reference:

Help / About Eclipse / Installation Details - Provides your plugin set details

Step 2 - Remove snap and install from Installer

To remove the snap and install from installer

  1. Remove snap - "sudo snap remove eclipse"
  2. Get Eclipse installer from https://www.eclipse.org/downloads.
  3. Ensure have JDK installed: "sudo apt install default-jdk"
  4. Untar the installer: "cd ~/Downloads" & "tar -xzvf eclipse-inst-jre-linux64.tar.gz"
  5. Run the installer: "cd eclipse-installer" & "sudo ./eclipse-inst". Depending on what you select as your target build set this may take a while as it downloads the required plugins.

Step 3 - Reinstall plugins via market place

Base on your "Installation Environment" capture from "Step 1" just re-install the required set of plugins.

Step 4 - Confirm performance improvement

Performance improvement from Eclipse snap to Eclipse Installer was minimal and I double the number of CPU (from 2 to 4) and RAM (from 4096MB to 8192MB)

Performance wise it still looks like 20.04 LTS + snap Eclipse is a much better option, even with half the resources

I then change my .profile ("export JAVA_OPTIONS=-Xmx4096m) to allocate more memory to Java VM (Eclipse is Java based IDE). Performance is still much worse than prior 20.04 installation.

As there are quite a lot of layer in this setup: KVM/QEMU, Gnome Update (including "triple buffering") and new Eclipse snap, trying to pin point the contributing cause is hard. So I retested with a dedicated test host.

Host #2:

  • Lenovo Server
  • Dual 10 Core CPUs (with hyperthreading == 40 CPUS)
  • 64GB RAM
  • Ubuntu 22.04
  • Libvirt 8.0.0
  • QEMU API 8.0.0
  • Hypervisor QEMU 6.2.0

Running a guest Eclipse VM on dedicated server does not display performance issues. But this is throwing at entire machines resources at a single application. As the performance was fine, I did not test with IOMMU disabled.

Watching Eclipse it appears to be spending an inordicate of time updating maven indexes, disabling "Window/Preferences/Maven/Download repository index updates on startup", appears to make a small impact, but the poor UI performance is also seen with FireFox browser as well, indicating that this is not just an Eclipse problem.

Further testing I created new Ubuntu 20.04 guest with "snap Eclipse" configured as per the Ubuntu 22.04 ones (both snap & installer based)/

The difference in performance is huge, the 20.04 VM with only 2 CPU / 4096MB RAM is snappy and responsive, while the 22.04 VM with 4 CPU / 8192MB RAM is almost unusable for source editing and developing.


Conclusion

My conclusion is that performance wise the Installer Elipse perform a little better than the 22.04 snap Eclipse, but unless you have some need that can only be meet with newer Ubuntu and Eclipse environment then I would stick with Ubuntu 20.04 LTS and its snap Eclipse.

I think I will raise a bug report on both Eclipse and Ubuntu...

NOTE: There is bug report on this on LaunchPad, work around is to increase the vgamem allocated to QXL driver.  See example snippet:

...
...
...
    <video>
      <model type='qxl' ram='131072' vram='65536' vgamem='65536' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
...
...
...

References & Links:

The "Snapped" Branched - from "Tree Recovery For Homeowners", recommedation is to "Say Goodbye" as its a "Hopeless Case". Is it time to move to VS Code, afterall ?

Ubuntu LauchPad Bug - "massive performance issues since 22.04 upgrade" reports but that appears to have IOMMU as its core, but disablnig PCI Passthrough for server is not an option for me.

Ubuntu Discorse - "Why Ubuntu 22.04 is so fast (and now to make it faster)" reports on Gnome "triple buffering" support and the speed improvement this provides... so the opposite of the above LaunchPad bug. So performance is obvioulsy HW setup sensitive...

Ubuntu LaunchPad Bug Report: "frequent 15-sec guest freeze with ubuntu 22.04 host and guest", includes a workaround of increasing QEMU/libvert vgamem allocation.