Would the zram-swap package help in this case? See e.g.:
@Bin you might like to try it and see if it helps.