public void TestGarbageCollection() { for (var i = 0; i < 1000000; i++) { var csharp = new CsharpClass(i.ToString(CultureInfo.InvariantCulture)); //You create a new memory allocation in every loop } //Approximately the GC ran 403 times for this loop Assert.IsTrue(GetTotalCollections() < 700); }
public void OutOfMemory() { var csharpList = new List<CsharpClass>(); for (var i = 0; i < 9000000; i++) //We increment the number of loops to create an OutOfMemoryException { var csharp = new CsharpClass(i.ToString(CultureInfo.InvariantCulture)); csharpList.Add(csharp); } //Performance is affected severely and program will never reach this point *On most commercial machines Assert.IsTrue(GetTotalCollections() < 403); }
public TypeofNode(INodeGraph bp) : base(bp) { m_Class = classList.Values[0]; m_NodeTypeOutput = new TypeOC(m_Class.type); m_NodeCombo = new ComboSC(classList.Keys); m_NodeCombo.OnSelected += new ComboSC.SelectAction(OnClassTypeSelected); AddComponet(m_TextTitleBar); AddComponet(m_NodeCombo); AddComponet(m_NodeTypeOutput); }
public void OutOfMemory() { var csharpList = new List <CsharpClass>(); for (var i = 0; i < 9000000; i++) //We increment the number of loops to create an OutOfMemoryException { var csharp = new CsharpClass(i.ToString(CultureInfo.InvariantCulture)); csharpList.Add(csharp); } //Performance is affected severely and program will never reach this point *On most commercial machines Assert.IsTrue(GetTotalCollections() < 403); }