Re: Org element cache in indirect buffers

2023-06-13 Thread Ihor Radchenko
[Adding Org ML back to CC] Sebastian writes: > Thank you so much for the detailed explanation! > > Maybe memory-report is counting what's at the end of the reference, and > your change fixes it. memory-report is counting buffer data separately, even when buffer-local variables reference to the

Re: Org element cache in indirect buffers

2023-06-13 Thread Ihor Radchenko
Ihor Radchenko writes: >> I also wonder if this means the caching is performed by each indirect buffer >> independently, and doesn't carry over. > > Caching is using base buffer actually. > I guess we can explicitly set reference to the cache root to nil in > indirect buffers. Done, on main. ht

Re: Org element cache in indirect buffers

2023-06-11 Thread Ihor Radchenko
Sebastian Wålinder writes: > It appears that indirect buffers duplicate the entire org element cache from > the base buffer whenever created. Not exactly. Only link to the cache root is copied and some cache elements may not be garbage-collected. > Running `memory-report` indicates that each i

Org element cache in indirect buffers

2023-06-11 Thread Sebastian Wålinder
Hello! It appears that indirect buffers duplicate the entire org element cache from the base buffer whenever created. Running `memory-report` indicates that each indirect buffer has the same memory blueprint. This becomes a massive issue with large org files. My in my 160 000 line org file, t