ILRuntime热更工程怎么释放内存

ILRuntime热更工程怎么释放内存

在热更工程中用数组保存的本地类对象,在重新创建时怎么释放原来的内存?

class MyStrct
{
        public int intParam;
        public string strParam;
        public GameObject objParam;
        public Transform tranParam;

        public void clear()
        {
            objParam = null;
            tranParam = null;
        }
}

class MemTest
    {
        private string name = "MemTest";
        public MyStrct[] myBytes = null;

        public void OnInit()
        {
            myBytes = new MyStrct[6];
        }


        public void CreateMB()
        {
            for (int i = 0; i < myBytes.Length; i++)
            {
                myBytes[i] = new MyStrct();
                myBytes[i].intParam = i * 10;
                myBytes[i].strParam = i + "随便填写的内容";
            }
                
        }

        public void Clean()
        {
            for (int i = 0; i < myBytes.Length; i++)
            {
                myBytes[i].clear();
                myBytes[i] = null;
            }
        }

        public void Destroy()
        {
            for (int i = 0; i < myBytes.Length; i++)
            {
                myBytes[i].clear();
                myBytes[i] = null;
            }
                
            myBytes = null;
        }
    }

在某一时刻我像重置 myBytes 中数据 回再次调用 CreateMB方法 之后也会调用 clean 和Destroy 方法,但内存都不见掉下来!

怎么释放 ILRuntime 映射工程中创建的内存?