Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【错误回报】内存泄漏? #183

Closed
SK-415 opened this issue Jul 21, 2022 · 2 comments
Closed

【错误回报】内存泄漏? #183

SK-415 opened this issue Jul 21, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@SK-415
Copy link
Owner

SK-415 commented Jul 21, 2022

运行环境

Ubuntu

HarukaBot 版本

v1.4.0

go-cqhttp 版本

1.0.0-rc3

错误描述

运行一段时间之后内存显著增加,甚至可能崩溃停止。

怀疑的可能原因:

  • 过于频繁的错过 scheduler 堆积
  • gRPC 频繁超时引发内存泄漏
  • 截图失败 Chromium 内存泄漏

以上仅为猜测,仍需要更多实验,最好能稳定复现。

报错日志(如果有)

No response

@SK-415 SK-415 added the bug Something isn't working label Jul 21, 2022
@SK-415 SK-415 added this to the v1.4.1 milestone Jul 21, 2022
@wu5288540
Copy link

使用的nonebot版插件。这几天内存泄漏有点严重,BOT运行着就会突然被killed,没有活过24小时的,短的就三五个小时,查询原因都是内存溢出被鲨。查日志,明显可见的异常为scheduler报错,随着运行,类似于“[WARNING] apscheduler | Execution of job "dy_sched (trigger: interval[0:00:05], next run at: 2022-07-22 11:00:15 CST)" skipped: maximum number of running instances reached (1)”的类似报错不断增多,动态截图将逐渐无法执行,只能发链接,图片全部发送失败,堆积到一定程度就killed,若同时触发其他插件的功能导致负载增加(例如发图插件),就会大幅度提高猝死概率。修改scheduler的频率,从1秒改到3秒,到5秒,到10秒,依然会出现问题,只是killed的时间会有所差异。
scheduler报错在没有转发动态的情况下几乎不会出现,但只要转发过动态就会开始出现堆积,几乎会在转发动态的下一个任务节点时间出现,疑似任务冲突,可能是截图发图所需时间较长占用了scheduler结果卡掉了后面的任务?尚不确定,期待修正

@yaowan233
Copy link

参考microsoft/playwright-python#1433
使用playwright的时候应使用上下文管理器而不是使用同一个browser实例,这样不会释放内存

@SK-415 SK-415 closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants