guoguobaba
V2EX  ›  Windows

windows 11 内存泄漏是什么原因

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

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