From 6ac8ee41af1157f65988a93ac16c826425f0a08d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 21 Mar 2021 22:44:37 +0100 Subject: [PATCH] Collect Playlist::ContentsChanged() signals #8626 With a large session: Editor::insert_time() -> Playlist::shift() -> 4000+ regions are modified -> 4k calls to Region::send_change() -> --"-- Playlist::region_changed () -> --"-- Playlist::region_bounds_changed () -> --"-- Playlist::notify_contents_changed () -> --"-- ContentsChanged () /* EMIT SIGNAL */ -> --"-- DiskReader::playlist_modified () -> 4k Session::request_overwrite_buffer events are queued The butler thread processes them all in the background, but this also enqueues 4k+ events to the GUI event pool since the GUI subscribed to Playlist::ContentsChanged (). However the GUI is inside Editor::insert_time() and cannot handle events. So they keep accumulating, and eventually hits "POOL OUT OF MEMORY - RECOMPILE WITH LARGER SIZE!" -=- This fixes the issue by collecting blocking ::notify_contents_changed until all region_changed() events are processed, and a single call to Playlist::flush_notifications() notifies the UI and disk-reader. --- libs/ardour/ardour/playlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 283b58aa0e..b6241cdc51 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -326,10 +326,10 @@ protected: ~RegionWriteLock () { Glib::Threads::RWLock::WriterLock::release (); + thawlist.release (); if (block_notify) { playlist->release_notifications (); } - thawlist.release (); } ThawList thawlist;