小编Sea*_*eid的帖子

永久启用我的代码

我正在使用visual studio 2010,每次打开它时,都会禁用"工具 - >选项 - >调试下的"我的代码".有谁知道如何永久启用此功能?

如果这有任何不同,我启用了以下扩展:

.NET反射器视觉工作室扩展; NuGet包管理器; 流程模板编辑器; 生产力电动工具; specflow; WITDesigner

debugging visual-studio-2010 visual-studio-debugging

19
推荐指数
1
解决办法
2004
查看次数

为什么c#垃圾收集器在满足请求之前不会继续尝试释放内存?

请考虑以下代码:

using System;

namespace memoryEater
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("alloc 1");
            var big1 = new BigObject();

            Console.WriteLine("alloc 2");
            var big2 = new BigObject();

            Console.WriteLine("null 1");
            big1 = null;

            //GC.Collect();

            Console.WriteLine("alloc3");
            big1 = new BigObject();

            Console.WriteLine("done");
            Console.Read();
        }
    }

    public class BigObject
    {
        private const uint OneMeg = 1024 * 1024;
        private static int _idCnt;
        private readonly int _myId;
        private byte[][] _bigArray;

        public BigObject()
        {
            _myId = _idCnt++;
            Console.WriteLine("BigObject {0} creating... ", _myId);

            _bigArray …
Run Code Online (Sandbox Code Playgroud)

c# garbage-collection finalizer

9
推荐指数
1
解决办法
2565
查看次数