I've only tested this in two versions, 15a and 20a. It appears that every time that the memory is cleared, I get a massive lag spike and frame drops from 5ms to +100ms.
EDIT: I also attached what is coming up in the log when the spike happens.
The debug file I'm attaching is the one that goes along with this video that was recorded in 20w20a. https://youtu.be/gk4xBxAGzAI
This video is from 20w15a https://youtu.be/NpsO2XW24p8 and has no debug profile with it, but also shows it happening on a newly generated flat-world. If needed I am more than happy to provide a debug report and video on a flat world as well.
Please check if that's still an issue for you in the latest 1.16.5 stable release or the latest 1.17 development snapshot.