Пример #1
0
		public ListItem(ListItem nextItem)
		{
			next = nextItem;
	
			// make allocations in smaller blocks to avoid them to be treated in a special way, which is designed for large blocks
			for (int i = 0; i < 1024; i++)
				array[i] = new byte[1024];
		}
Пример #2
0
		void ExtendHeap()
		{
			Trace("HeapExtend.ExtendHeap");

			if (buttonAppLaunch)
				buttonAppLaunch.SetFalse(false);

			ListItem listHead = null;
			long TotalMem = 128 * 1024 * 1024;
			long StartMem = GC.GetTotalMemory(false);
			Trace("StartMem = " + StartMem);

			try
			{
				do
				{
					// Create a new item at the head of the list
					listHead = new ListItem(listHead);
				}
				while ((GC.GetTotalMemory(false) - StartMem) < TotalMem);
			}
			catch (Exception e)
			{
				Trace("Exception in ExtendHeap: " + e);
			}

			final = new ListItem(null);

			Trace("EndMem = " + GC.GetTotalMemory(false));

			// Release the whole list
			listHead = null;
		}