Beispiel #1
0
 public jemallocTest()
 {
     Jem.Init("dirty_decay_ms:1,muzzy_decay_ms:1,tcache:false,narenas:3");
     init_privateMemorySize = CurrentProcess.PrivateMemorySize64;
     init_peakPagedMem      = CurrentProcess.PeakPagedMemorySize64;
     init_peakWorkingSet    = CurrentProcess.PeakWorkingSet64;
     init_peakVirtualMem    = CurrentProcess.PeakVirtualMemorySize64;
     init_allocated         = Jem.AllocatedBytes;
 }
Beispiel #2
0
        public void CanMallocandFree()
        {
            Jem.Init("retain=false");
            long size = 100 * 1000 * 1000;

            Assert.True(init_privateMemorySize < size);
            Assert.True(init_allocated < (ulong)size);
            IntPtr p         = Jem.Malloc((ulong)size);
            string stats     = Jem.MallocStats;
            ulong  allocated = Jem.GetMallCtlUInt64("stats.allocated");

            CurrentProcess.Refresh();
            Assert.True((CurrentProcess.PrivateMemorySize64 - init_privateMemorySize) >= size);
            Assert.True(allocated > (ulong)size);
            Jem.Free(p);
        }
 public jemallocTest()
 {
     Jem.Init("tcache:false,narenas:3");
 }
Beispiel #4
0
 public override void GlobalSetup()
 {
     base.GlobalSetup();
     Jem.Init("dirty_decay_ms:0,muzzy_decay_ms:0,junk:false,tcache:false");
 }