https://bugs.documentfoundation.org/show_bug.cgi?id=167007
--- Comment #9 from Patrick (volunteer) <[email protected]> --- (In reply to Patrick (volunteer) from comment #8) > I wonder if using the solution for tdf#166007 could work with the image > cache that GraphicsMemoryLimit controls: Correction: I should have written "the solution for tdf#166994". Anyway, apparently the GraphicsMemoryLimit image cache already has similar code to my fix for tdf#166994. The current code uses a minimum time that an image is supposed to remain in the cache which the default is 10 seconds. The fix for tdf#166994 only needed 5 seconds so I think 10 seconds should be enough so I put some printf's in the cache code and found that the bug occurs when the first frame of an animation is removed from the cache. After that, all of the other frames in an animation are never readded to the cache. AFAICT, with the following debug patch, once the bug occurs, I see a blizzard of "unregister" (i.e. remove from the cache) calls interspersed with an occasional "register" (i.e. add to the cache). Also, in those blizzard of "unregister" calls, the image being removed does not exist in the cache. So my current theory is that once the bug occurs, every frame is being swapped in, drawn, and then swapped out and this repeated swapping in and out is what is slowing the animations: diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index bafa2711cbff..3db528153d52 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -87,6 +87,7 @@ void MemoryManager::registerObject(MemoryManaged* pMemoryManaged) assert(aGuard.owns_lock() && aGuard.mutex() == &maMutex); // coverity[missing_lock: FALSE] - as above assert mnTotalSize += pMemoryManaged->getCurrentSizeInBytes(); +fprintf(stderr, "register: %p\n", pMemoryManaged); maObjectList.insert(pMemoryManaged); checkStartReduceTimer(); } @@ -95,6 +96,8 @@ void MemoryManager::unregisterObject(MemoryManaged* pMemoryManaged) { std::unique_lock aGuard(maMutex); mnTotalSize -= pMemoryManaged->getCurrentSizeInBytes(); +auto it = maObjectList.find(pMemoryManaged); +fprintf(stderr, "unregister: %p %i\n", pMemoryManaged, it == maObjectList.end() ? 1 : 0); maObjectList.erase(pMemoryManaged); checkStartReduceTimer(); } -- You are receiving this mail because: You are the assignee for the bug.
