3 ms·
At the very least, we can provide bounds. What you and Chromium report is an upperbound. We could provide a lowerbound defined as: def thread_low(t): return
by scott_s 16y ago
At the very least, we can provide bounds. What you and Chromium report is an upperbound. We could provide a lowerbound defined as:
def thread_low(t): return resident_set(t) - shared_set(t)
lowerbound = sum(map(thread_low, all_threads)) + min(map(shared_set, all_threads))
(Forgive the Python notation, it would actually be easier to express this using actual summations if I could draw freehand, but given that I can't, I figure code would be clearer.)
For all threads in the process, we know that it must be solely responsible for its resident set minus its shared set. This already is a lower bound, but it ignores what is shared. We can increase (improve) this lowerbound a bit by figuring out what the smallest shared set among all of the threads is. If my thinking is correct, then we can be sure the total memory used won't be lower than this.