简体   繁体   English

释放进程中未使用的内存

[英]Release Unused Memory on Process

We use a software panel at our company to manage all of our game servers. 我们使用公司的软件面板来管理我们所有的游戏服务器。 There is a feature in it to turn on Low Memory Usage. 它具有打开低内存使用率的功能。 I have never used it, but as some newer Java games are absolute RAM hogs, I have been investigating it. 我从未使用过它,但是由于某些较新的Java游戏是绝对的RAM猪,因此我一直在对其进行调查。 I have written a Daemon application to manage these processes, and would like to find out more about releasing unused RAM so that I can do this when no players are currently connected. 我已经编写了一个Daemon应用程序来管理这些进程,并且想了解有关释放未使用的RAM的更多信息,以便在当前没有播放器连接时可以执行此操作。

Here is the description the developers of the software panel gave me for the feature... 这是软件面板开发人员针对该功能给我的描述...

As we all know gameservers are not designed to streamline RAM usage. 众所周知,游戏服务器并非旨在简化RAM使用。 Normally a game will take whatever RAM it needs to startup and simply hold onto that RAM amount. 通常,游戏会占用启动所需的任何RAM,而只需保持该RAM数量即可。

The low memory feature simply releases any unused RAM at timed intervals. 低内存功能仅按时间间隔释放所有未使用的RAM。 Then if the game requires the RAM again it will grab it. 然后,如果游戏再次需要RAM,它将抓住它。 This is an old feature that was designed to work primarily with Q3 based games. 这是一个旧功能,主要设计用于基于Q3的游戏。 However it is possible that others games may benefit from it as well. 但是,其他游戏也可能会从中受益。

I would say turn it on for one server and see what happens. 我会说为一台服务器打开它,然后看看会发生什么。 Of course there are no guaratees that it will not cause issues with the game. 当然,没有任何保证不会导致游戏出现问题。

How are they going about doing this with C# .NET? 他们将如何使用C#.NET进行此操作? I am launching the Java processes from a .NET executable and managing it from there, so worst cases scenario it would be worth giving it a shot. 我正在从.NET可执行文件启动Java进程并从那里进行管理,因此在最坏的情况下,值得一试。

继续并使用在http://www.codeguru.com/forum/showthread.php?t=368990上找到的信息,并查看其工作原理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM