Message117355
> Answering the question as best I can: I don't know how the reference
> counter is implemented in CPython, but if it's just a field in a
> struct, then madvise could be sent the memory location starting with
> the byte immediately following the reference counter
Well, first, this would only work for large objects. Must objects in Python are quite small individually, unless you have very large (unicode or binary) strings, or very big integers.
Second, madvise() works at the page granularity (4096 bytes on most system), and it will be very likely this will include the reference count for the current object.
Third, MADV_MERGEABLE will only be efficient if you have actual duplications of whole memory pages (and, practically, if you have enough of them to make a real difference). Why do you think you might have such duplication in your workload? |
|
Date |
User |
Action |
Args |
2010-09-25 10:34:45 | pitrou | set | recipients:
+ pitrou, georg.brandl, amaury.forgeotdarc, hunteke |
2010-09-25 10:34:45 | pitrou | set | messageid: <1285410885.61.0.662159471861.issue9942@psf.upfronthosting.co.za> |
2010-09-25 10:34:44 | pitrou | link | issue9942 messages |
2010-09-25 10:34:43 | pitrou | create | |
|