Answers for "restrict memory use python code"

0

restrict memory use python code

# using resource 
import resource 
 
def limit_memory(maxsize): 
    soft, hard = resource.getrlimit(resource.RLIMIT_AS) 
    resource.setrlimit(resource.RLIMIT_AS, (maxsize, hard))
Posted by: Guest on April-05-2022

Python Answers by Framework

Browse Popular Code Answers by Language