qjr
qjr
  • 发布:2025-07-29 09:55
  • 更新:2025-07-29 09:55
  • 阅读:39

【报Bug】nvue + navigateTo 切换导致app的JSE 进程内存上涨

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: window 11

HBuilderX类型: 正式

HBuilderX版本号: 4.57

手机系统: Android

手机系统版本号: Android 12

手机厂商: 三星

手机机型: S21

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view class="container">  
        <button @click="goto">跳转 test 页面</button>  
    </view>  
</template>  

<script>  
    export default {  
        methods: {  
            goto() {  
                uni.navigateTo({  
                    url: '/pages/test/test'  
                })  
            }  
        }  
    }  
</script>  

<style scoped>  
    .container {  
        flex: 1;  
        justify-content: center;  
        align-items: center;  
    }  
</style>  

<template>  
    <view class="container">  
        <button @click="back">返回 index 页面</button>  
    </view>  
</template>  

<script>  
    export default {  
        methods: {  
            back() {  
                uni.navigateBack()  
            }  
        }  
    }  
</script>  

<style scoped>  
    .container {  
        flex: 1;  
        justify-content: center;  
        align-items: center;  
    }  
</style>

操作步骤:

打开 index.nvue 页面,点击按钮跳转到 test.nvue;
在 test.nvue 页面点击返回;
自动化测试程序来回循环以上步骤 10分钟;
通过如下命令查看内存:
adb shell dumpsys meminfo xxx

预期结果:

app的jse线程内存不会上涨

实际结果:

app的jse线程内存持续上涨

bug描述:

在一个最小的 nvue 页面 Demo 中,仅实现了两个页面 navigateTo + navigateBack 的基本跳转逻辑。在页面中无复杂逻辑,无定时器、无图片、无原生模块引用,仅使用 <button> 实现跳转。

反复进行跳转和返回后,通过 adb 查看 jse 进程的内存持续增长,并不会被释放,最终导致 app 崩溃。

2025-07-29 09:55 负责人:无 分享
已邀请:

要回复问题请先登录注册