We are writing a system in which memory is dense. There are several python processes that will import the same set of classes. If processes load gazillion classes, and each process consumes a couple of hundred megabytes, then 10 processes, and I run to concerts. Is there a way to “split” class imports between python processes?
Summary:
import classA # Process 1 : loads classA in memory import classA # Process 2 : reuses what was loaded previously by Process 1
PS: What I'm trying to achieve is what you do with modules .soin C / C ++.
.so
, ( ). import , fork(), .
import
fork()
, , , refcounts . , , .
, python. , , . , 100 , , - (, ).
, , , - python, C/++. , python . .
P.S. python , . C/++, , .