Пример #1
0
        void ReportMemoryUsage(string iterationName)
        {
            //Make sure IDE stops doing what it was doing
            UserInterfaceTests.Ide.WaitForIdeIdle();

            // This is to prevent leaking of AppQuery instances.
            TestService.Session.DisconnectQueries();

            var heapshotTask = profilerProcessor?.TakeHeapshot();

            var memoryStats = TestService.Session.MemoryStats;

            Console.WriteLine(iterationName);

            Console.WriteLine("  NonPagedSystemMemory: " + memoryStats.NonPagedSystemMemory);
            Console.WriteLine("  PagedMemory: " + memoryStats.PagedMemory);
            Console.WriteLine("  PagedSystemMemory: " + memoryStats.PagedSystemMemory);
            Console.WriteLine("  PeakVirtualMemory: " + memoryStats.PeakVirtualMemory);
            Console.WriteLine("  PrivateMemory: " + memoryStats.PrivateMemory);
            Console.WriteLine("  VirtualMemory: " + memoryStats.VirtualMemory);
            Console.WriteLine("  WorkingSet: " + memoryStats.WorkingSet);

            Console.WriteLine();

            if (heapshotTask != null)
            {
                leakProcessor.Process(heapshotTask, iterationName == "Cleanup", iterationName, memoryStats);
            }
        }
Пример #2
0
        void ReportMemoryUsage(int iteration)
        {
            //Make sure IDE stops doing what it was doing
            UserInterfaceTests.Ide.WaitForIdeIdle();

            // This is to prevent leaking of AppQuery instances.
            TestService.Session.DisconnectQueries();
            Heapshot heapshot = null;

            if (profilerProcessor != null)
            {
                heapshot = profilerProcessor.TakeHeapshotAndMakeReport().Result;
            }

            var memoryStats = TestService.Session.MemoryStats;

            string iterationName;

            if (iteration == cleanupIteration)
            {
                iterationName = "Cleanup";
            }
            else if (iteration == setupIteration)
            {
                iterationName = "Setup";
            }
            else
            {
                iterationName = string.Format("Run_{0}", iteration + 1);
            }

            Console.WriteLine(iterationName);

            Console.WriteLine("  NonPagedSystemMemory: " + memoryStats.NonPagedSystemMemory);
            Console.WriteLine("  PagedMemory: " + memoryStats.PagedMemory);
            Console.WriteLine("  PagedSystemMemory: " + memoryStats.PagedSystemMemory);
            Console.WriteLine("  PeakVirtualMemory: " + memoryStats.PeakVirtualMemory);
            Console.WriteLine("  PrivateMemory: " + memoryStats.PrivateMemory);
            Console.WriteLine("  VirtualMemory: " + memoryStats.VirtualMemory);
            Console.WriteLine("  WorkingSet: " + memoryStats.WorkingSet);

            Console.WriteLine();

            leakProcessor.Process(heapshot, iteration == cleanupIteration, iterationName, memoryStats);
        }