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

L7多次执行“创建-销毁“过程,会出现内存泄漏的问题 #2172

Open
seanzb1985 opened this issue Dec 15, 2023 · 3 comments
Open

Comments

@seanzb1985
Copy link

问题描述

请参见提供的demo, 当用L7.Map 和L7.GaodeMap 初始化L7 Scene实例, 正常添加layer渲染,正常渲染后,执行scene的destroy 操作,重复多次(20次),当执行最后一次scene销毁操作后,发现内存有泄漏。
用不同底图,表现略有不同

  1. 用L7.GaodeMap时,GPU内存增加的很大。
  2. 用L7.Map时,发现Dom 有事件重复挂载不摘除的问题。

重现链接

https://codesandbox.io/p/sandbox/great-shape-tj3thr?file=%2Findex.html%3A5%2C29

重现步骤

  1. 打开demo 链接,

  2. 打开chrome任务管理器,记录开始前内存情况。

  3. 点击Start ,自动执行Gaode 底图的20次创建销毁操作。

  4. 结束以后,再次观察内存变化。

  5. 然后修改GaodeMap 为Map,
    scene = new L7.Scene({ map: new L7.Map({ center: [120.19382669582967, 30.258134], pitch: 0, zoom: 3, }), //map: new L7.GaodeMap({ //token: "aa6f555ae5e4ced230195f3f52db5898", //center: [120.19382669582967, 30.258134], //pitch: 0, //zoom: 3, //}), });

  6. 重复步骤2-4, 观察Map底图的20次创建销毁内存变化。

预期行为

调查L7.Map地图和L7.GaodeMap 重复创建销毁内存泄漏问题,并修复。

平台

  • 操作系统: [ Windows]
  • 网页浏览器: [Google Chrome]

屏幕截图或视频(可选)

L7.GaodeMap
执行start 前
image
20次创建销毁后
image

L7.Map
执行20次创建销毁后,dom 上遗留的事件列表
image

补充说明(可选)

当地图使用的数据越大,内存泄漏问题约明显。

Copy link
Contributor

Hi @seanzb1985, Please star this repo if you find it useful! Thanks ⭐!
你好 @seanzb1985。如果该仓库对你有用,可以 star 一下,感谢你的 ⭐!

@lzxue
Copy link
Contributor

lzxue commented Dec 15, 2023

感谢,反馈

@taiyuanhy
Copy link
Contributor

初步排查,高德地图gpu process持续变高看上去是高德地图自己没有释放干净,或者是我们没有调对释放的接口。Map事件遗留的问题是bug,已提交pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants