The issue is that CONFIG_ANDROID_LOW_MEMORY_KILLER is enabled. I'm not sure why this is on in the Ubuntu default kernel configuration as it implements Android-specific behaviour. I installed the latest upstream kernel package and the kernel config still has the low memory killer enabled, so the same issue exists there too.
The issue is that CONFIG_ ANDROID_ LOW_MEMORY_ KILLER is enabled. I'm not sure why this is on in the Ubuntu default kernel configuration as it implements Android-specific behaviour. I installed the latest upstream kernel package and the kernel config still has the low memory killer enabled, so the same issue exists there too.