Ubuntu 16.04 barely using swap

I am trying to setup a server with 4Gb ram using 32bit Ubuntu 16.04 LTS and I ran into an interesting problem that I hope I can get some help with.

I am trying to process some large data files on this new server with python, but python crashes with a memory error (it runs our of ram). I have setup a swap partition with multiple GB’s worth of memory but the server barely uses the swap.

Barely is the important word here since roughly 80 Mb worth of swap is being used. Therefore I think (please correct me if I am wrong here) that the swap is setup correctly since the system is using it.

Now I have tried to play with the swapiness, but that does not seem to help (the current value is 100).

The processing of these large data files happens at night and therefore low performance due to swap usage is not a problem.

Would anybody be able to explain to me why Ubuntu might not use it’s swap memory and just throw a memory error?

Thanks in advance,

Cheers, Hilbert