Test case in bug 143514 shows that some objects present on a sheet may be lost and not disposed when using "clear contents" function. They may be kept in memory even after closing the document in non-debug builds (bug 143514 caught them being destroyed in dbgutil cleanup code, that doesn't run in release builds - see https://gerrit.libreoffice.org/c/core/+/119433).
https://gerrit.libreoffice.org/c/core/+/119435
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/64a55fe5f457e4b3d5222deb560f6d5072696160 tdf#143515: avoid memory leak in ScDrawLayer::DeleteObjectsInArea It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/99420dc0b80df22d12519efca05803898fbfcfbd tdf#143515: avoid memory leak in ScDrawLayer::DeleteObjectsInArea It will be available in 7.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.