V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
guoguobaba
V2EX  ›  Windows

windows 11 内存泄漏是什么原因

  •  
  •   guoguobaba · Jul 30, 2025 · 3023 views
    This topic created in 275 days ago, the information mentioned may be changed or developed.

    开了 wsl ,用着用着,内存就满了,我 64g 内存,问了一下 gpt ,让我用 rammap 分析,结果如下,

    https://imgur.com/PxkWq9a.png

    wsl --shutdown 也没有啥用。

    重启后正常,但是用了一天又这样了。

    11 replies    2025-07-30 16:52:27 +08:00
    guoguobaba
        1
    guoguobaba  
    OP
       Jul 30, 2025
    guoguobaba
        2
    guoguobaba  
    OP
       Jul 30, 2025
    cc666
        3
    cc666  
       Jul 30, 2025
    安装了 docker 么,或者试试这个
    #!/bin/bash
    while true
    do
    echo 3 > /proc/sys/vm/drop_caches
    sleep 300
    done
    guoguobaba
        4
    guoguobaba  
    OP
       Jul 30, 2025
    @cc666 我已经 shutdown wsl 了,但是内存还是没法释放。
    cc666
        5
    cc666  
       Jul 30, 2025
    @guoguobaba 是的,遇到过这个问题,你装了 docker 没,试了我上面给的脚本没
    lisxour
        6
    lisxour  
       Jul 30, 2025
    看下最后一个选项卡,file details
    march1993
        7
    march1993  
       Jul 30, 2025
    截图看一下 Processes 页呢?按里面 Total 降序排列
    weenhall5
        8
    weenhall5  
       Jul 30, 2025
    [wsl2]
    memory=8GB
    processors=4
    限制下 wsl 使用内存和 cpu 试下
    Hephaistos
        9
    Hephaistos  
       Jul 30, 2025
    wsl 默认情况最大也就用一半内存……64 满不了的啊
    Cusox
        10
    Cusox  
       Jul 30, 2025
    遇到过这种情况,我是 Mapped File 占用大,用 RamMap 上面的 Empty 都清空一遍就好了

    开机正常,过久了占用就上去了
    nnnnnnamgn
        11
    nnnnnnamgn  
       Jul 30, 2025
    .wslconfig 里限制一下内存使用,再把 experiment 里 autoMemoryReclaim 改为 gradual ,不过 wsl --shutdown 都不能释放内存我觉得问题不在这,wsl -l --running 看看是不是有多个子系统;也可以不用 wsl ,其他正常使用一两天看看是不是还会泄露
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2481 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 07:12 · PVG 15:12 · LAX 00:12 · JFK 03:12
    ♥ Do have faith in what you're doing.