Open JohanCDev opened 1 year ago
import resource
def limit_memory(maxsize): soft, hard = resource.getrlimit(resource.RLIMIT_AS) resource.setrlimit(resource.RLIMIT_AS, (maxsize, hard))
This only works on linux, there is an other way to do on windows but I wasn't able to implement it