修改长时间内存会炸
This commit is contained in:
@@ -95,6 +95,10 @@ namespace WebSite.Controllers
|
||||
if (hostModal != null)
|
||||
{
|
||||
item.Status = hostModal.Status;
|
||||
if (hostModal.ModalType==DeviceType.AirConditioner)
|
||||
{
|
||||
item.Status = hostModal.AirConditionData.AirStatus;
|
||||
}
|
||||
item.Brightness = hostModal.Brightness;
|
||||
var aaa = hostModal.AirConditionData;
|
||||
item.CurrentTemp = aaa.CurrentTemp;
|
||||
|
||||
@@ -229,15 +229,11 @@ namespace WebSite
|
||||
T.Stop();
|
||||
double d = CPUData.GetCPU();
|
||||
DataTongJi.CPU_Data.Add(d);
|
||||
// 简单的上限保护,避免长期积累导致内存膨胀
|
||||
//if (DataTongJi.CPU_Data.Count > 1000)
|
||||
//{
|
||||
// DataTongJi.CPU_Data = new System.Collections.Concurrent.ConcurrentBag<double>();
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("CPU 数量统计出错了:" + ex.Message);
|
||||
logger.Error("CPU 数量统计出错了:" + ex.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user