壁纸自动切换的内存泄漏问题
Tofloor
poster avatar
ExplosiveBattery
deepin
2018-04-17 14:33
Author
本帖最后由 ExplosiveBattery 于 2018-4-17 06:55 编辑

@qwrasfzxv @Tonys @nero28 @ lcw0268 @cxbii @MattD @hnuzhoulin @vowers @yanbowen
之前看论坛,找到有人推荐gsettings来切换桌面背景
https://bbs.deepin.org/post/29808
https://bbs.deepin.org/post/144934
兄弟,这个内存泄露问题还存在
https://bugzilla.redhat.com/show_bug.cgi?id=995799
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730522
顺便发一个我的脚本:
  1. #!/bin/bash
  2. # 随机文件版
  3. PATH=/home/$USER/Pictures/Wallpapers/*
  4. while [ 1 -eq 1 ]; do
  5.         list=$(/bin/echo $PATH)
  6.         num=$(/bin/echo $list | /usr/bin/wc -w)
  7.         filepath=$(/bin/echo $list | /usr/bin/awk "{print \$[$RANDOM%num]}")
  8.     /usr/bin/gsettings set com.deepin.wrap.gnome.desktop.background picture-uri file://$filepath
  9.     /bin/sleep $[$1];
  10. done
  11. # 固定循环版
  12. # while [ 1 -eq 1 ]; do
  13. #     for i in $(echo $PATH/*); do
  14. #         echo $i
  15. #         gsettings set com.deepin.wrap.gnome.desktop.background picture-uri file://${i}
  16. #         sleep $[10*60];
  17. #     done
  18. # done
Copy the Code
每一次切换桌面背景,用free -m可以看到shared memory以及buffer/cache memory增长了不少,后者包含了前者。
ipcs命令查看不出来,清除buffer/cache memory的那个echo 1或2或3到/proc/xxxx也无效。
我试过占满内存以为只是shared,后来想起自己整个背景文件夹也才80MB,但是泄露内存已经有6个G。试过一直涨到满,之后就在用swap。


都存在内存泄露:gsettings的这种设置方法,或者qdbus --literal com.deepin.wm /com/deepin/wm com.deepin.wm.ChangeCurrentWorkspaceBackground ""



Reply Favorite View the author
All Replies
1 / 2
To page
avatar
yanbowen
deepin
Community Developer
2018-04-17 17:02
#1
Reply View the author
avatar
sonald
deepin
2018-04-17 17:26
#2
请描述一下你的显卡和驱动,因为泄露很可能在drm这块
Reply View the author
avatar
sonald
deepin
2018-04-17 17:28
#3
另外,换壁纸最好用qdbus com.deepin.wm  /com/deepin/wm com.deepin.wm.ChangeCurrentWorkspaceBackground,如果不需要注销后保存最后换的壁纸,
用 qdbus com.deepin.wm  /com/deepin/wm com.deepin.wm.SetTransientBackground效率更好。
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-17 18:47
#4
显卡:Intel Corporation HD Graphics 530
独显被我关闭了:
controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev ff)
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-17 18:51
#5
刚刚试了一下qdbus com.deepin.wm  /com/deepin/wm com.deepin.wm.SetTransientBackground,你看
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-17 18:52
#6
https://bbs.deepin.org/post/155474
刚刚试了一下qdbus com.deepin.wm  /com/deepin/wm com.deepin.wm.SetTransientBackground,你看

shared在逐渐变大,还是存在内存泄露问题
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-17 18:57
#7
本帖最后由 ExplosiveBattery 于 2018-4-17 10:59 编辑
https://bbs.deepin.org/post/155474
请描述一下你的显卡和驱动,因为泄露很可能在drm这块

用的是6700HQ的530核显,那么驱动也应该就是安装系统时自动选择的驱动
那两条qdbus也存在不断增大Shared内存却不释放的问题
Reply View the author
avatar
aida
deepin
2018-04-17 21:43
#8
https://bbs.deepin.org/post/155474
用的是6700HQ的530核显,那么驱动也应该就是安装系统时自动选择的驱动
那两条qdbus也存在不断增大Shared内 ...

已创建任务跟踪。
Reply View the author
avatar
sonald
deepin
2018-04-17 23:46
#9
shared增大很正常,free爆了才不正常。另外,我测试了300轮壁纸更换没有发现严重的内存问题,目前还在测。
你用的什么系统,deepin-wm,libdeepin-mutter0g是什么版本?我一开始就说这很可能是显卡出现了内存泄露。
Reply View the author
avatar
牧野
deepin
2018-04-18 00:48
#10
这是专业测试么??
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-18 01:03
#11
本帖最后由 ExplosiveBattery 于 2018-4-17 17:13 编辑
https://bbs.deepin.org/post/155474
shared增大很正常,free爆了才不正常。另外,我测试了300轮壁纸更换没有发现严重的内存问题,目前还在测。
...

将我脚本里的sleep时间设置成为3,当然设置成为1就能更加容易看到效果。
shared增大确实看起来是一件正常的事情,但是当你发现你用ipcs命令看到相关内容也不能用ipcrm去释放,它也不会自己释放的时候就是一件大事情
随着shared的增大,free会越来越少,最后用上swap

用的是最新的ISO安装好经过dist-upgrade后的系统, 版本请见图
补充deepin-wm实际上是deepin-wm is already the newest version (1.9.21-3)
kernel还是4.14.12-2 ,图片中见到的4.14.21我还没安装
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-18 01:26
#12
本帖最后由 ExplosiveBattery 于 2018-4-17 17:27 编辑
https://bbs.deepin.org/post/155474
shared增大很正常,free爆了才不正常。另外,我测试了300轮壁纸更换没有发现严重的内存问题,目前还在测。
...

刚刚用室友的台式机16.04 Ubuntu,把脚本稍微改了一下去试
也出现了内存泄露,不过用free -m查看只能看到Used变大以及Free变小,Shard和buffer/cache没有变化。
看来deepin的free.....要更新了



Reply View the author
avatar
132******49
deepin
2018-04-18 15:33
#13
我用Variety自动切换壁纸,也会存在内存泄漏的问题
Reply View the author
avatar
sonald
deepin
2018-04-18 18:43
#14
昨天排查后,感觉这个问题最有可能是cogl或者clutter导致的,因为泄露的部分来源可能来自内核的drm。泄露的不是shmem,用ipcrm当然删不掉。另外,不用跟ubuntu比,它没用cogl。
Reply View the author
avatar
sonald
deepin
2018-04-18 18:43
#15
后面继续跟,不过看样子不好处理
Reply View the author
avatar
sonald
deepin
2018-04-19 01:15
#16
问题解决了,等15.5.1更新
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-19 05:15
#17
本帖最后由 ExplosiveBattery 于 2018-5-2 17:00 编辑
https://bbs.deepin.org/post/155474
问题解决了,等15.5.1更新

好的,期待!
================透点剧情====================
从以下网址下载最新版的mutter即可.....再用切换脚本...先行享受壁纸切换.........
https://ci.deepin.io/search/?q=deepin-mutter

================补充====================
效果有点问题,继续看下去
Reply View the author
avatar
sonald
deepin
2018-04-19 18:11
#18
https://bbs.deepin.org/post/155474
好的,期待!
================透点剧情====================
从以下网址下载最新版的mutter即可.....再用 ...

牛叉:)
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-19 22:26
#19

哥们,有点问题,终端等窗口的透明度失效了,右下角的输入法使用的时候容易出现黑框,见图片

我估计和你把if判断去掉有关系......我把源码下过来看看
Reply View the author
avatar
ExplosiveBattery
deepin
2018-04-20 20:02
#20

解决了
不能用那个版本号里面的deepin-mutter
我已经上传两个在附件,后面的人看到安装即可
Reply View the author
1 / 2
To page