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

内存占用过大 #138

Closed
2 tasks done
Joackk opened this issue Nov 28, 2023 · 13 comments · Fixed by #153
Closed
2 tasks done

内存占用过大 #138

Joackk opened this issue Nov 28, 2023 · 13 comments · Fixed by #153
Assignees
Labels
help wanted Extra attention is needed

Comments

@Joackk
Copy link

Joackk commented Nov 28, 2023

Brief summary

就正常使用,突然发现整个电脑都卡了起来,看了下任务管理器发现内存用满了,我是32G内存
image
并且关了进程还有个后台进程再继续占用超高的内存。最近偶尔会遇到。与之前对比就是最近多装了几个插件。然后搜索时候有时候会有几个报错
image
不知道是不是上面这个报错导致的

Steps to reproduce

No response

Miru version

1.7.2

Device

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • If this is an issue with a extension, I should be opening an issue in the extension repository.
@Joackk Joackk added the help wanted Extra attention is needed label Nov 28, 2023
@Joackk
Copy link
Author

Joackk commented Nov 29, 2023

似乎开启时间过长也会导致这个问题,我是昨晚开的,然后留在了视频目录页面。然后睡觉时候改成了睡眠状态,所以第二天是直接恢复了源状态并没有进行什么操作。然后准备看会视频时候发现很卡。看了下内存又用了15个G的内存。不知道什么情况

@Joackk
Copy link
Author

Joackk commented Nov 29, 2023

在看了会视频后返回首页后,发现这内存占用在不断增加。虽然增加的不快,但是一直在加,是没有自动释放内存吗?

@MiaoMint
Copy link
Member

MiaoMint commented Dec 5, 2023

按理来说应该退出视频界面会释放内存,你只是看了视频然后退出视频界面然后内存就开始一直增加吗?

@Joackk
Copy link
Author

Joackk commented Dec 5, 2023

按理来说应该退出视频界面会释放内存,你只是看了视频然后退出视频界面然后内存就开始一直增加吗?

我也不确定这是什么情况了,因为最近一段时间使用中,有时候打开半小时看了会视频他就开始使用了4-8G内存了,然后关闭重开又恢复正常。有的时候开一天中途也会使用看视频什么的,但是内存都使用正常。有点无法确定他这个到底是啥情况了。就正常使用有的时候用一会就内存占用飙升到几个G,有的时候用一天他也正常

@yhsj0919
Copy link

内存增加大概率是 media_kit的问题,在我应用中,多次调用 player.open(),会导致内存持续增加,而不会释放,长时间播放也会导致内存增加

@MiaoMint
Copy link
Member

内存增加大概率是 media_kit的问题,在我应用中,多次调用 player.open(),会导致内存持续增加,而不会释放,长时间播放也会导致内存增加

原来是这样

@yhsj0919
Copy link

可以尝试限制一下最大缓存

void initVideo() async {
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('cache', 'yes');
    }
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('demuxer-max-bytes', '30MiB');
    }
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('demuxer-readahead-secs', '20');
    }
  }

demuxer-max-bytes demuxer-readahead-secs

我测试的时候没有明显增加内存,但是在另一个应用中,开多个客户端只有一个生效,
其他的还是会不断增大内存

@Joackk
Copy link
Author

Joackk commented Dec 12, 2023

可以尝试限制一下最大缓存

void initVideo() async {
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('cache', 'yes');
    }
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('demuxer-max-bytes', '30MiB');
    }
    if (player.platform is NativePlayer) {
      await (player.platform as dynamic).setProperty('demuxer-readahead-secs', '20');
    }
  }

demuxer-max-bytes demuxer-readahead-secs

我测试的时候没有明显增加内存,但是在另一个应用中,开多个客户端只有一个生效, 其他的还是会不断增大内存

这个问题似乎还不是固定的,因为我是偶尔会遇到,还不是此次都会遇到,就挺奇怪的

@MiaoMint MiaoMint self-assigned this Dec 13, 2023
@MiaoMint MiaoMint linked a pull request Dec 19, 2023 that will close this issue
@MiaoMint
Copy link
Member

MiaoMint commented Dec 19, 2023

@Joackk
Copy link
Author

Joackk commented Dec 19, 2023

@Joackk Joackk closed this as completed Dec 19, 2023
@MiaoMint
Copy link
Member

还有这个问题嘛? @Joackk

@Joackk
Copy link
Author

Joackk commented Dec 20, 2023

还有这个问题嘛? @Joackk

暂时的使用没有遇到,但是我不确定,因为之前他也不是固定触发,而是偶尔会触发,有时候蛮久都不触发。今天开了一天是没有遇到,应该没了

@romanticfire
Copy link

romanticfire commented May 31, 2024

image
今天我使用也遇到了这个问题
大概连续看了四个小时左右
miru.log
日志文件在这里

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants