Почитайте, возможно, будет интересно:
https://bluelight.org/xf/threads/gc%E2%80%99s-guide-to-not-losing-the-magic.910721/