Unix 错误消息“Killed" [英] Unix error message "Killed"

查看:20
本文介绍了Unix 错误消息“Killed"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Unix 平台(当前运行 c shell)上使用 C++ 开发十六进制游戏.我的游戏的 AI 需要不到一分钟的时间来决定它的移动(我使用的是一种蒙特卡罗算法),经过几步,程序自行终止,在返回到我的命令提示符.有没有人了解导致这种情况发生的原因,并对我如何更改代码以修复它有任何建议?如果它有帮助,我没有使用我的系统.我使用 SSH Secure Shell 连接到我学校的服务器.我还应该指出,我不认为我的算法有问题,因为它在崩溃之前一直按照我的预期工作,但是在决定第 7 步时它始终崩溃.

I am working on a game of Hex in C++ on a Unix platform (Currently running c shell). The AI for my game takes less than a minute to decide on its move (I'm using a sort of Monte Carlo algorithm), and after a few steps, the program terminates on its own, merely printing "Killed" before returning to my command prompt. Does anyone understand what is causing this to happen, and have any suggestions as to how I might go about changing my code to fix it? If it helps at all, I am not using my system. I am connected to my school's server using SSH Secure Shell. I should also point out that I don't think its something wrong with my algorithm because it works as I expect it to until the crash, but it consistently crashes while deciding its 7th move.

推荐答案

这就是执行此操作的内存不足管理器.很可能你有某种内存泄漏.如果您想继续处理内存泄漏,您可以在另一个会话中运行这样的脚本.将 processname 替换为您的二进制文件的名称.

That's the out of memory manager that does that. Most likely you have some sort of memory leak. If you want to continue with the memory leak you can run a script like this in another session. Replace processname with the name of your binary.

#!/bin/bash
while true; do {
    pgrep -x "processname" | while read PID; do {
        echo -1000 > /proc/$PID/oom_score_adj; 
    } done;
} done;

这篇关于Unix 错误消息“Killed"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆