修改长时间内存会炸

This commit is contained in:
2026-03-25 17:51:43 +08:00
parent 1840794f40
commit d0c626c189
61 changed files with 82737 additions and 271 deletions

View File

@@ -11,8 +11,24 @@
<RootNamespace>ConsoleApplication4</RootNamespace>
<AssemblyName>ConsoleApplication4</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -46,6 +62,41 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj">
<Project>{1D7073B2-4CC3-49F5-9F37-50A21D74A39D}</Project>
<Name>CommonEntity</Name>
</ProjectReference>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{B3F29715-E925-4E56-9248-580F06C3BC11}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

View File

@@ -3,6 +3,9 @@ using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using Common;
using System.Timers;
using CommonEntity;
namespace ConsoleApplication4
{
@@ -21,39 +24,85 @@ namespace ConsoleApplication4
{
private static bool _isRunning = true;
static void Main(string[] args)
public static System.Timers.Timer CPUTimer = null;
public static void StartCPUTongJiTask()
{
Console.CancelKeyPress += (sender, e) =>
{
_isRunning = false;
e.Cancel = true;
};
try
{
var udpClient = new UdpClient(3340);
udpClient.Client.ReceiveBufferSize = 3 * 1024 * 1024;
// 开始接收
udpClient.BeginReceive(ReceiveCallback, new UdpState(udpClient));
Console.WriteLine("UDP服务器已启动按Ctrl+C停止...");
// 保持程序运行
while (_isRunning)
{
Thread.Sleep(100);
}
udpClient.Close();
Console.WriteLine("服务器已停止");
CPUTimer = new System.Timers.Timer();
CPUTimer.Elapsed += new ElapsedEventHandler(CPUtimer_Elapsed);
//10分钟统计一次
//现在修改成20秒
//CPUTimer.Interval = 1 * 60 * 1000;
CPUTimer.Interval = 1000;
CPUTimer.Start();
}
catch (Exception ex)
{
Console.WriteLine($"启动失败: {ex.Message}");
}
}
static private void CPUtimer_Elapsed(object sender, ElapsedEventArgs e)
{
var T = sender as System.Timers.Timer;
try
{
// 防止重入
T.Stop();
double d = CPUData.GetCPU();
DataTongJi.CPU_Data.Add(d);
Console.WriteLine("aaaaaaaaaa");
}
catch (Exception ex)
{
Console.WriteLine("出错了:"+ex.Message);
}
finally
{
// 恢复计时器
T.Start();
}
}
static void Main(string[] args)
{
StartCPUTongJiTask();
var a= CPUData.GetCPU();
Console.WriteLine(a);
var b = CPUData.GetNowPrecise();
Console.WriteLine(b.ToString());
Console.ReadLine();
//Console.CancelKeyPress += (sender, e) =>
//{
// _isRunning = false;
// e.Cancel = true;
//};
//try
//{
// var udpClient = new UdpClient(3340);
// udpClient.Client.ReceiveBufferSize = 3 * 1024 * 1024;
// // 开始接收
// udpClient.BeginReceive(ReceiveCallback, new UdpState(udpClient));
// Console.WriteLine("UDP服务器已启动按Ctrl+C停止...");
// // 保持程序运行
// while (_isRunning)
// {
// Thread.Sleep(100);
// }
// udpClient.Close();
// Console.WriteLine("服务器已停止");
//}
//catch (Exception ex)
//{
// Console.WriteLine($"启动失败: {ex.Message}");
//}
}
public static void ReceiveCallback(IAsyncResult ar)
{
UdpState state = ar.AsyncState as UdpState;

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]

View File

@@ -2,3 +2,42 @@ E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\b
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\ConsoleApplication4.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\obj\x86\Debug\ConsoleApplication4.exe
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\obj\x86\Debug\ConsoleApplication4.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\obj\x86\Debug\ConsoleApplication4.csprojResolveAssemblyReference.cache
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\ConsoleApplication4.exe.config
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Common.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\log4net.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NHibernate.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\M2Mqtt.Net.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CacheManager.Core.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CSRedisCore.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Newtonsoft.Json.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\aliyun-net-sdk-core.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\aliyun-net-sdk-dysmsapi.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.OOXML.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\System.ValueTuple.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Iesi.Collections.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Antlr3.Runtime.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Remotion.Data.Linq.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\ICSharpCode.SharpZipLib.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.OpenXmlFormats.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.OpenXml4Net.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Common.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\M2Mqtt.Net.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CacheManager.Core.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CSRedisCore.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CSRedisCore.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Newtonsoft.Json.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.OOXML.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\System.ValueTuple.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\NPOI.OpenXml4Net.xml
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CommonEntity.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Domain.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\jose-jwt.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\RestSharp.dll
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\CommonEntity.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\Domain.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\jose-jwt.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\RestSharp.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\RestSharp.xml