Antoine Pitrou <pit...@free.fr> added the comment:

> 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?

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9942>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to