dengyonggang
dengyonggang
采纳率0%
2015-06-29 10:51 阅读 5.0k

用c#写了个多线程小程序,占用内存不断的增大,虚心求教

cleanDataTimer.Elapsed += new ElapsedEventHandler(CleanData);
cleanDataTimer.Interval = 0.000000000006;
cleanDataTimer.Enabled = true;

        Thread addRCSMemoryData = new Thread(new ThreadStart(AddRCSMemoryDeviceData));
        addRCSMemoryData.Start();

        Thread addRCSDBData = new Thread(new ThreadStart(AddRCSDataBaseDeviceData));
        addRCSDBData.Start();

        Thread addRCSDBASEGEMENTDeviceDataTimer = new Thread(new ThreadStart(NetDeviceInfo.GetRCSDBASEGMENTNetDeviceData));
        addRCSDBASEGEMENTDeviceDataTimer.Start();


        Thread addRCSMemoryASEGEMENTDeviceDataTimer = new Thread(new ThreadStart(NetDeviceInfo.GetRCSMemoryASEGMENTNetDeviceData));
        addRCSMemoryASEGEMENTDeviceDataTimer.Start();

        Thread addRCSDBBSEGEMENTDeviceDataTimer = new Thread(new ThreadStart(NetDeviceInfo.GetRCSDBBSEGMENTNetDeviceData));
        addRCSDBBSEGEMENTDeviceDataTimer.Start();


        Thread addRCSMemoryBSEGEMENTDeviceDataTimer = new Thread(new ThreadStart(NetDeviceInfo.GetRCSMemoryBSEGMENTNetDeviceData));
        addRCSMemoryBSEGEMENTDeviceDataTimer.Start();









        Console.WriteLine("按回车键结束程序");
        Console.WriteLine(" 等待程序的执行......");
        Console.ReadLine();
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • oyljerry oyljerry 2015-06-30 03:24

    线程是不是不停的在分配,分配的资源使用完了,有没有让它自动回收

    点赞 评论 复制链接分享

相关推荐