VCMI on Raspberry pi

I am trying to test this game under opengl mesa driver on my rpi3 but I run out of memory on compiling. seems weird because I compile a kernel and bigger programs on my pi with less ram. I dont get any warning, only slowing down on 40%-44% even with one core (to use less ram).