C# Gabbage Collecting System

* 这个程序非常巧妙的探测了一下垃圾回收机制,发现如下结论:
 * 当内存紧急时,才会启动垃圾回收GC.Collect()
 * 从此程序的运行上来看,delete是连续出现的,这体现了垃圾回收的强度。
 * new haha()这种东西确实是垃圾,会被回收的(除非它有timer,这个对象被另一个线程占用)

using System;
using System.Windows.Forms;
using System.Threading;
class haha
{
    int[] a=new int[10000000];
    haha()
    {
        Console.WriteLine("created");
    }
    void run()
    {
        Console.WriteLine("i am running");
    }
    ~haha()
    {
        Console.WriteLine("deleted");
    }
    static void Main(){
        for (int i = 0; i < 100; i++)
        {
            new haha().run();
            GC.Collect();
        }
        Application.Run();
    }
}
时间: 2024-10-03 21:54:13

C# Gabbage Collecting System的相关文章

【转】刚发现一个linux在线文档库。很好很强大。

原文网址:http://blog.csdn.net/longxibendi/article/details/6048231 1.网址: http://www.mjmwired.net 2.比如查看这个 proc.txt ,就在这里能找到. http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt 内核参数解释全在这里了.不过,也可以下载内核完源代码,从/usr/src/linux/Documentation/proc.tx

Ubuntu安装sar出错Please check if data collecting is enabled in /etc/default/sysstat

1.安装sysstat apt-get install sysstat 2.安装后无法使用: Cannot open /var/log/sysstat/sa02: No such file or directory Please check if data collecting is enabled in /etc/default/sysstat 3.修改配置文件:vi /etc/default/sysstat 将False改为True ---- # Should sadc collect sy

Network management system scheduling for low power and lossy networks

In one embodiment, a network management system (NMS) determines an intent to initialize a request-response exchange with a plurality of clients in a low power and lossy network (LLN). In response, the NMS adaptively schedules corresponding responses

POJ 2907 Collecting Beepers (DFS+回溯)

Description Karel is a robot who lives in a rectangular coordinate system where each place is designated by a set of integer coordinates (x and y). Your job is to design a program that will help Karel pick up a number of beepers that are placed in he

Adaptive partitioning scheduler for multiprocessing system

A symmetric multiprocessing system includes multiple processing units and corresponding instances of an adaptive partition processing scheduler. Each instance of the adaptive partition processing scheduler selectively allocates the respective process

PatentTips - Method and system for browsing things of internet of things on ip using web platform

BACKGROUND The following disclosure relates to a method and system for enabling a user to browse physical things using a rich user interface (UI) via a web browser in Internet of Things (IoT) such that an end user has rich experience. Internet of Thi

Extensible File System

An extensible file system format for portable storage media is provided. The extensible file system format includes the specification of primary and secondary directory entry types that may be custom defined. The primary and secondary directory entry

Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D

报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D 解决方法: 编辑 hive-site.xml 文件,添加下边的属性 <property> <name>system:java.io.tmpdir<

China Operating System 电脑操作系统 2016全球互联网排名

韩梦飞沙  韩亚飞  [email protected]  yue31313  han_meng_fei_sha 电脑操作系统 China Operating System 2016全球互联网排名 ========