コード例 #1
0
        public void ObjectCount()
        {
            // Apparently there is no safe way to force a full GC on the JS side.
            // We will check that the number of live objects _at least_ got lower
            // than what we created.
            var dt = new TestClass();

            for (int i = 0; i < 100000; i++)
            {
                js.SetVariableFromAny("foo", dt);
            }
            js.SetVariableNull("foo");
            js.Flush();
            Assert.That(js.GetStats().KeepAliveUsedSlots, Is.LessThan(80000));
        }