My server getting fridge when the container get firdge

i try to build a project like where user can run there code and get the output. but i’m facing problem like what would happen if the any user run command like rm -r ./ and fork bomb kind of things … so i try docker container to prevent the this kind of attack … but won’t work … my server getting fridge when the this kind of code running in my container … so i need some solution for it…