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

High RAM consumption #969

Open
2 tasks done
Tracked by #1259
GeekerFeng opened this issue Aug 23, 2023 · 27 comments
Open
2 tasks done
Tracked by #1259

High RAM consumption #969

GeekerFeng opened this issue Aug 23, 2023 · 27 comments
Labels
bug Something isn't working platform:linux question Further information is requested

Comments

@GeekerFeng
Copy link

GeekerFeng commented Aug 23, 2023

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Neovim version

NVIM v0.9.1

Operating system/version

ubuntu 22.04

Terminal name/version

bash

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

Expected behavior

image

Actual behavior

如果长时间开着nvim,内存会越来越大,不会见效,最高达到了3G,我不知道怎么查看具体内存消耗在那里,可以协助解决一下么

Additional information

No response

@GeekerFeng GeekerFeng added the bug Something isn't working label Aug 23, 2023
@Jint-lzxy
Copy link
Collaborator

Which file (filetype) are u editing and what server(s) are u using?

@Jint-lzxy Jint-lzxy changed the title 内存过高 High RAM consumption Aug 23, 2023
@Jint-lzxy Jint-lzxy added needs:repro We need more details to reproduce this problem platform:linux labels Aug 23, 2023
@GeekerFeng
Copy link
Author

GeekerFeng commented Aug 23, 2023

My project. Similar to TI's SDK source code. Use c to write. and used lsp

@Jint-lzxy
Copy link
Collaborator

Thanks for the info! Can you provide more information regarding the memory map of that process? Those given by pmap(1) and /proc/(Process-PID)/maps should suffice.

@CharlesChiuGit
Copy link
Collaborator

close for inactive

@CharlesChiuGit CharlesChiuGit closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
@GeekerFeng
Copy link
Author

Sorry, I'm too busy with work recently and don't have time to reply. Can you still help me investigate?

@GeekerFeng
Copy link
Author

GeekerFeng commented Sep 11, 2023

The map information is as follows

f@f:~/Tool$ cat /proc/4735/maps
55726c600000-55726c610000 r-xp 00000000 00:00 0 
557286a11000-557286a9e000 r--p 00000000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
557286a9e000-557286deb000 r-xp 0008d000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
557286deb000-557286efe000 r--p 003da000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
557286efe000-557286f17000 r--p 004ec000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
557286f17000-557286f29000 rw-p 00505000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
557286f29000-557286f42000 rw-p 00000000 00:00 0 
557287e7d000-557287ea3000 rw-p 0146c000 07:0c 12                         /snap/nvim/2809/usr/bin/nvim
5572898ac000-55728f549000 rw-p 00000000 00:00 0                          [heap]
55728f550000-55728f560000 r-xp 00000000 00:00 0 
5572a17b0000-5572a1800000 r-xp 00000000 00:00 0 
5572b7de0000-5572b7df0000 r-xp 00000000 00:00 0 
5572c2890000-5572c28a0000 r-xp 00000000 00:00 0 
7f2e2abf1000-7f2e9abf2000 rw-p 00000000 00:00 0 
7f2ef6f2c000-7f2ef7d2d000 rw-p 00000000 00:00 0 
7f2ef7fcd000-7f2ef922e000 rw-p 00000000 00:00 0 
7f2ef922e000-7f2ef923f000 rw-p 00000000 00:00 0 
7f2ef924f000-7f2efec0a000 rw-p 00000000 00:00 0 
7f2efec0a000-7f2eff30b000 rw-p 00000000 00:00 0 
7f2eff30b000-7f2f00bfb000 rw-p 00000000 00:00 0 
7f2f00c00000-7f2f05b08000 rw-p 00000000 00:00 0 
7f2f05b09000-7f2f07237000 rw-p 00000000 00:00 0 
7f2f0723f000-7f2f08258000 rw-p 00000000 00:00 0 
7f2f08276000-7f2f08af0000 rw-p 00000000 00:00 0 
7f2f08af0000-7f2f08af2000 r--p 00000000 08:03 1348305                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown_inline.so
7f2f08af2000-7f2f08b0e000 r-xp 00002000 08:03 1348305                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown_inline.so
7f2f08b0e000-7f2f08b42000 r--p 0001e000 08:03 1348305                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown_inline.so
7f2f08b42000-7f2f08b43000 r--p 00051000 08:03 1348305                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown_inline.so
7f2f08b43000-7f2f08b44000 rw-p 00052000 08:03 1348305                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown_inline.so
7f2f08b44000-7f2f08b47000 r--p 00000000 08:03 1348247                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown.so
7f2f08b47000-7f2f08b5f000 r-xp 00003000 08:03 1348247                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown.so
7f2f08b5f000-7f2f08b98000 r--p 0001b000 08:03 1348247                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown.so
7f2f08b98000-7f2f08b99000 r--p 00053000 08:03 1348247                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown.so
7f2f08b99000-7f2f08b9a000 rw-p 00054000 08:03 1348247                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/markdown.so
7f2f08b9a000-7f2f08fd7000 rw-p 00000000 00:00 0 
7f2f08fd8000-7f2f0a47e000 rw-p 00000000 00:00 0 
7f2f0a483000-7f2f0b49f000 rw-p 00000000 00:00 0 
7f2f0b4a7000-7f2f0c000000 rw-p 00000000 00:00 0 
7f2f0c000000-7f2f0c0db000 rw-p 00000000 00:00 0 
7f2f0c0db000-7f2f10000000 ---p 00000000 00:00 0 
7f2f1001f000-7f2f1031f000 rw-p 00000000 00:00 0 
7f2f10320000-7f2f12800000 rw-p 00000000 00:00 0 
7f2f12800000-7f2f12804000 r--p 00000000 08:03 1247454                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/cpp.so
7f2f12804000-7f2f1281a000 r-xp 00004000 08:03 1247454                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/cpp.so
7f2f1281a000-7f2f12a35000 r--p 0001a000 08:03 1247454                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/cpp.so
7f2f12a35000-7f2f12a37000 r--p 00234000 08:03 1247454                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/cpp.so
7f2f12a37000-7f2f12a38000 rw-p 00236000 08:03 1247454                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/cpp.so
7f2f12a52000-7f2f12ad2000 rw-p 00000000 00:00 0 
7f2f12ad3000-7f2f13a93000 rw-p 00000000 00:00 0 
7f2f13a9b000-7f2f13c5b000 rw-p 00000000 00:00 0 
7f2f13c5c000-7f2f13cfc000 rw-p 00000000 00:00 0 
7f2f13d00000-7f2f14000000 rw-p 00000000 00:00 0 
7f2f14000000-7f2f140ee000 rw-p 00000000 00:00 0 
7f2f140ee000-7f2f18000000 ---p 00000000 00:00 0 
7f2f18000000-7f2f18056000 rw-p 00000000 00:00 0 
7f2f18056000-7f2f1c000000 ---p 00000000 00:00 0 
7f2f1c000000-7f2f1c0c0000 rw-p 00000000 00:00 0 
7f2f1c0c0000-7f2f20000000 ---p 00000000 00:00 0 
7f2f2001d000-7f2f2045d000 rw-p 00000000 00:00 0 
7f2f2045d000-7f2f20460000 r--p 00000000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f20460000-7f2f20479000 r-xp 00003000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f20479000-7f2f204d1000 r--p 0001c000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f204d1000-7f2f204d2000 ---p 00074000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f204d2000-7f2f204d3000 r--p 00074000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f204d3000-7f2f204d4000 rw-p 00075000 08:03 1247503                    /home/f/.local/share/nvim/site/lazy/nvim-treesitter/parser/c.so
7f2f204d4000-7f2f208f4000 rw-p 00000000 00:00 0 
7f2f2090b000-7f2f2090c000 r--p 00000000 07:0c 1224                       /snap/nvim/2809/usr/share/nvim/runtime/parser/ini.so
7f2f2090c000-7f2f2090d000 r-xp 00001000 07:0c 1224                       /snap/nvim/2809/usr/share/nvim/runtime/parser/ini.so
7f2f2090d000-7f2f2090e000 r--p 00002000 07:0c 1224                       /snap/nvim/2809/usr/share/nvim/runtime/parser/ini.so
7f2f2090e000-7f2f2090f000 r--p 00002000 07:0c 1224                       /snap/nvim/2809/usr/share/nvim/runtime/parser/ini.so
7f2f2090f000-7f2f20911000 rw-p 00003000 07:0c 1224                       /snap/nvim/2809/usr/share/nvim/runtime/parser/ini.so
7f2f20911000-7f2f20d31000 rw-p 00000000 00:00 0 
7f2f20d34000-7f2f20d74000 rw-p 00000000 00:00 0 
7f2f20d77000-7f2f20e77000 rw-p 00000000 00:00 0 
7f2f20e78000-7f2f20f38000 rw-p 00000000 00:00 0 
7f2f20f3a000-7f2f2119a000 rw-p 00000000 00:00 0 
7f2f2119b000-7f2f2167b000 rw-p 00000000 00:00 0 
7f2f2167c000-7f2f2171c000 rw-p 00000000 00:00 0 
7f2f2171c000-7f2f2171d000 ---p 00000000 00:00 0 
7f2f2171d000-7f2f21f1d000 rw-p 00000000 00:00 0 
7f2f21f1d000-7f2f21f1e000 ---p 00000000 00:00 0 
7f2f21f1e000-7f2f2271e000 rw-p 00000000 00:00 0 
7f2f2271e000-7f2f2271f000 ---p 00000000 00:00 0 
7f2f2271f000-7f2f22f1f000 rw-p 00000000 00:00 0 
7f2f22f1f000-7f2f22f20000 ---p 00000000 00:00 0 
7f2f22f20000-7f2f23a00000 rw-p 00000000 00:00 0 
7f2f23a00000-7f2f247e7000 r--p 00000000 08:03 14821688                   /usr/lib/locale/locale-archive
7f2f247eb000-7f2f247ec000 r--p 00000000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247ec000-7f2f247ed000 r-xp 00001000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247ed000-7f2f247ee000 r--p 00002000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247ee000-7f2f247ef000 r--p 00002000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247ef000-7f2f247f0000 rw-p 00003000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247f0000-7f2f247f1000 rw-p 00005000 07:0c 1167                       /snap/nvim/2809/usr/share/nvim/runtime/parser/comment.so
7f2f247f1000-7f2f247f2000 r--p 00000000 08:03 1222801                    /home/f/.local/share/nvim/site/lazy/fzy-lua-native/static/libfzy-linux-x86_64.so
7f2f247f2000-7f2f247f3000 r-xp 00001000 08:03 1222801                    /home/f/.local/share/nvim/site/lazy/fzy-lua-native/static/libfzy-linux-x86_64.so
7f2f247f3000-7f2f247f6000 r--p 00002000 08:03 1222801                    /home/f/.local/share/nvim/site/lazy/fzy-lua-native/static/libfzy-linux-x86_64.so
7f2f247f6000-7f2f247f7000 r--p 00004000 08:03 1222801                    /home/f/.local/share/nvim/site/lazy/fzy-lua-native/static/libfzy-linux-x86_64.so
7f2f247f7000-7f2f247f8000 rw-p 00005000 08:03 1222801                    /home/f/.local/share/nvim/site/lazy/fzy-lua-native/static/libfzy-linux-x86_64.so
7f2f247f8000-7f2f248fd000 rw-p 00000000 00:00 0 
7f2f248fd000-7f2f24925000 r--p 00000000 07:04 7380                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libc.so.6
7f2f24925000-7f2f24aba000 r-xp 00028000 07:04 7380                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libc.so.6
7f2f24aba000-7f2f24b12000 r--p 001bd000 07:04 7380                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libc.so.6
7f2f24b12000-7f2f24b16000 r--p 00214000 07:04 7380                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libc.so.6
7f2f24b16000-7f2f24b18000 rw-p 00218000 07:04 7380                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libc.so.6
7f2f24b18000-7f2f24b25000 rw-p 00000000 00:00 0 
7f2f24b25000-7f2f24b28000 r--p 00000000 07:04 7430                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7f2f24b28000-7f2f24b3f000 r-xp 00003000 07:04 7430                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7f2f24b3f000-7f2f24b43000 r--p 0001a000 07:04 7430                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7f2f24b43000-7f2f24b44000 r--p 0001d000 07:04 7430                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7f2f24b44000-7f2f24b45000 rw-p 0001e000 07:04 7430                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7f2f24b45000-7f2f24b53000 r--p 00000000 07:04 7481                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libm.so.6
7f2f24b53000-7f2f24bcf000 r-xp 0000e000 07:04 7481                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libm.so.6
7f2f24bcf000-7f2f24c2a000 r--p 0008a000 07:04 7481                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libm.so.6
7f2f24c2a000-7f2f24c2b000 r--p 000e4000 07:04 7481                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libm.so.6
7f2f24c2b000-7f2f24c2c000 rw-p 000e5000 07:04 7481                       /snap/core22/864/usr/lib/x86_64-linux-gnu/libm.so.6
7f2f24c2c000-7f2f24c2e000 rw-p 00000000 00:00 0 
7f2f24c2e000-7f2f24c30000 r--p 00000000 07:04 7351                       /snap/core22/864/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f2f24c30000-7f2f24c5a000 r-xp 00002000 07:04 7351                       /snap/core22/864/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f2f24c5a000-7f2f24c65000 r--p 0002c000 07:04 7351                       /snap/core22/864/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f2f24c66000-7f2f24c68000 r--p 00037000 07:04 7351                       /snap/core22/864/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f2f24c68000-7f2f24c6a000 rw-p 00039000 07:04 7351                       /snap/core22/864/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7ffe4bc7d000-7ffe4bc9f000 rw-p 00000000 00:00 0                          [stack]
7ffe4bd08000-7ffe4bd0c000 r--p 00000000 00:00 0                          [vvar]
7ffe4bd0c000-7ffe4bd0e000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0                  [vsyscall]

@GeekerFeng
Copy link
Author

Current memory usage
image

@GeekerFeng
Copy link
Author

When I closed the process, the memory saved 4G
image

@Jint-lzxy
Copy link
Collaborator

Looks like the problem comes from here:

7f2e2abf1000-7f2e9abf2000 rw-p 00000000 00:00 0

Some simple calculations yield:

      size: 1879052288 B [OR] 1879.052288 MB [OR] 1.879052288 GB
      perm: [R]ead, [W]rite, [-]Execute, [P]rivate
(*) source: Not mapped from a file (offset=dev=inode=0)
(*) nature: Anonymous mapped regions (blank for pathname)

So this region is probably created by mmap but are not attached to any file - that is to say, ur OS must be doing something trivial (such as using this block of memory as a new stack for some specific purposes). But I'm afraid we cant make further judgements unless u can provide detailed information (content) of this region.

@Jint-lzxy Jint-lzxy added question Further information is requested and removed needs:repro We need more details to reproduce this problem labels Sep 12, 2023
@GeekerFeng
Copy link
Author

Can you tell me which codes may cause this problem? I will solve this problem based on these codes.

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Sep 13, 2023

Can you tell me which codes may cause this problem?

Well actually this is where the problem kicks in - we have no idea where this region was mapped to (that's why it's called an "anonymous mapped region") unless u can provide detailed information (content) of this region.

@CharlesChiuGit
Copy link
Collaborator

completely random guessing here. it seems like u installed nvim via snap, can u try install nvim with other methods?
snap pkgs will sometimes have random issues here and there.

@GeekerFeng
Copy link
Author

I didn't install it using snap. I'm using appimage.
I'll try upgrading nvim to see if this problem is alleviated.

@GeekerFeng
Copy link
Author

I suddenly saw a prompt. The size of the prompt is the same as this memory. Is it related to this prompt?
image

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Sep 14, 2023

I would like to know if the insane ram usage is from nvim itself or the plugins. u can open 3 terminals:
- one opening any lsp-registered random file, nvim ~/.zshrc
- one open the same file with --clean flag, nvim --clean ~/.zshrc
- one use pmap -x {PID} to see the mem usage of above two process, and show us the log.

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Sep 14, 2023

I suddenly saw a prompt. The size of the prompt is the same as this memory. Is it related to this prompt? image

remove that file, reopen nvim, close nvim, cat the newly generated lsp.log and paste it here.

@GeekerFeng
Copy link
Author

When I rm lsp.log and reopen nvim, 13k lsp.log is generated
lsp.log

@GeekerFeng
Copy link
Author

GeekerFeng commented Sep 14, 2023

I would like to know if the insane ram usage is from nvim itself or the plugins. u can open 3 terminals: - one opening any lsp-registered random file, nvim ~/.zshrc - one open the same file with --clean flag, nvim --clean ~/.zshrc - one use pmap -x {PID} to see the mem usage of above two process, and show us the log.

The memory is normal when nvim is just opened. It gradually becomes larger during use. I can try to reproduce it again

220188:   nvim src/tda4/capture_tda4.c
Address           Kbytes     RSS   Dirty Mode  Mapping
0000000000400000      20      20       0 r---- nvim
0000000000405000     116     108       0 r-x-- nvim
0000000000422000      40      40       0 r---- nvim
000000000042c000       4       4       4 r---- nvim
000000000042d000       4       4       4 rw--- nvim
00000000018fd000     132     132     132 rw---   [ anon ]
000000000191e000     704     576     576 rw---   [ anon ]
00007f2080bff000       4       0       0 -----   [ anon ]
00007f2080c00000    8192       8       8 rw---   [ anon ]
00007f2081400000     160     160       0 r---- libc.so.6
00007f2081428000    1620     716       0 r-x-- libc.so.6
00007f20815bd000     352      64       0 r---- libc.so.6
00007f2081615000      16      16      16 r---- libc.so.6
00007f2081619000       8       8       8 rw--- libc.so.6
00007f208161b000      52      20      20 rw---   [ anon ]
00007f20817a7000     136       4       4 rw---   [ anon ]
00007f20817c9000      28      28       0 r---- libfuse.so.2.9.9
00007f20817d0000     112     112       0 r-x-- libfuse.so.2.9.9
00007f20817ec000      40      40       0 r---- libfuse.so.2.9.9
00007f20817f6000       4       0       0 ----- libfuse.so.2.9.9
00007f20817f7000      72      40      12 r---- libfuse.so.2.9.9
00007f2081809000       4       4       4 rw--- libfuse.so.2.9.9
00007f208180a000       8       8       8 rw---   [ anon ]
00007f208180c000       8       8       0 r---- libz.so.1.2.11
00007f208180e000      68      68       0 r-x-- libz.so.1.2.11
00007f208181f000      24      24       0 r---- libz.so.1.2.11
00007f2081825000       4       0       0 ----- libz.so.1.2.11
00007f2081826000       4       4       4 r---- libz.so.1.2.11
00007f2081827000       4       4       4 rw--- libz.so.1.2.11
00007f2081828000       4       4       0 r---- libpthread.so.0
00007f2081829000       4       0       0 r-x-- libpthread.so.0
00007f208182a000       4       0       0 r---- libpthread.so.0
00007f208182b000       4       4       4 r---- libpthread.so.0
00007f208182c000       4       4       4 rw--- libpthread.so.0
00007f208182d000       4       4       0 r---- libdl.so.2
00007f208182e000       4       0       0 r-x-- libdl.so.2
00007f208182f000       4       0       0 r---- libdl.so.2
00007f2081830000       4       4       4 r---- libdl.so.2
00007f2081831000       4       4       4 rw--- libdl.so.2
00007f2081848000       8       8       8 rw---   [ anon ]
00007f208184a000       8       8       0 r---- ld-linux-x86-64.so.2
00007f208184c000     168     168       0 r-x-- ld-linux-x86-64.so.2
00007f2081876000      44      40       0 r---- ld-linux-x86-64.so.2
00007f2081882000       8       8       8 r---- ld-linux-x86-64.so.2
00007f2081884000       8       8       8 rw--- ld-linux-x86-64.so.2
00007ffe0d127000     132      36      36 rw---   [ stack ]
00007ffe0d18a000      16       0       0 r----   [ anon ]
00007ffe0d18e000       8       0       0 r-x--   [ anon ]
ffffffffff600000       4       0       0 --x--   [ anon ]
---------------- ------- ------- ------- 
total kB           12384    2520     880
220268:   nvim --clean src/tda4/capture_tda4.c
Address           Kbytes     RSS   Dirty Mode  Mapping
0000000000400000      20      20       0 r---- nvim
0000000000405000     116     108       0 r-x-- nvim
0000000000422000      40      40       0 r---- nvim
000000000042c000       4       4       4 r---- nvim
000000000042d000       4       4       4 rw--- nvim
00000000015a4000     132     132     132 rw---   [ anon ]
00000000015c5000     776     648     648 rw---   [ anon ]
00007f85f7bff000       4       0       0 -----   [ anon ]
00007f85f7c00000    8192       8       8 rw---   [ anon ]
00007f85f8400000     160     160       0 r---- libc.so.6
00007f85f8428000    1620     716       0 r-x-- libc.so.6
00007f85f85bd000     352      64       0 r---- libc.so.6
00007f85f8615000      16      16      16 r---- libc.so.6
00007f85f8619000       8       8       8 rw--- libc.so.6
00007f85f861b000      52      20      20 rw---   [ anon ]
00007f85f868a000     136       4       4 rw---   [ anon ]
00007f85f86ac000      28      28       0 r---- libfuse.so.2.9.9
00007f85f86b3000     112     112       0 r-x-- libfuse.so.2.9.9
00007f85f86cf000      40      40       0 r---- libfuse.so.2.9.9
00007f85f86d9000       4       0       0 ----- libfuse.so.2.9.9
00007f85f86da000      72      52      12 r---- libfuse.so.2.9.9
00007f85f86ec000       4       4       4 rw--- libfuse.so.2.9.9
00007f85f86ed000       8       8       8 rw---   [ anon ]
00007f85f86ef000       8       8       0 r---- libz.so.1.2.11
00007f85f86f1000      68      64       0 r-x-- libz.so.1.2.11
00007f85f8702000      24      24       0 r---- libz.so.1.2.11
00007f85f8708000       4       0       0 ----- libz.so.1.2.11
00007f85f8709000       4       4       4 r---- libz.so.1.2.11
00007f85f870a000       4       4       4 rw--- libz.so.1.2.11
00007f85f870b000       4       4       0 r---- libpthread.so.0
00007f85f870c000       4       0       0 r-x-- libpthread.so.0
00007f85f870d000       4       0       0 r---- libpthread.so.0
00007f85f870e000       4       4       4 r---- libpthread.so.0
00007f85f870f000       4       4       4 rw--- libpthread.so.0
00007f85f8710000       4       4       0 r---- libdl.so.2
00007f85f8711000       4       0       0 r-x-- libdl.so.2
00007f85f8712000       4       0       0 r---- libdl.so.2
00007f85f8713000       4       4       4 r---- libdl.so.2
00007f85f8714000       4       4       4 rw--- libdl.so.2
00007f85f872b000       8       8       8 rw---   [ anon ]
00007f85f872d000       8       8       0 r---- ld-linux-x86-64.so.2
00007f85f872f000     168     168       0 r-x-- ld-linux-x86-64.so.2
00007f85f8759000      44      40       0 r---- ld-linux-x86-64.so.2
00007f85f8765000       8       8       8 r---- ld-linux-x86-64.so.2
00007f85f8767000       8       8       8 rw--- ld-linux-x86-64.so.2
00007fffff1d0000     132      40      40 rw---   [ stack ]
00007fffff1f9000      16       0       0 r----   [ anon ]
00007fffff1fd000       8       0       0 r-x--   [ anon ]
ffffffffff600000       4       0       0 --x--   [ anon ]
---------------- ------- ------- ------- 
total kB           12456    2604     956

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Sep 14, 2023

[ERROR][2023-09-14 11:26:01] .../vim/lsp/rpc.lua:675	"rpc"	"/home/f/.local/share/nvim/mason/bin/clangd"	"stderr"	"E[11:26:01.248] System include extraction: driver clang not found in PATH\n"

maybe try fix this issue?

other lsp.log errrors looks fine, and yeah, the ram usage looks fine from the pmap for now.

@GeekerFeng
Copy link
Author

Okay, I will try to fix the clang error and continue to see if it is resolved.

@GeekerFeng
Copy link
Author

I found that I might have pmap the wrong process before. I pmap the process in the red box before. Their memory is almost the same
image

Now I pmap the process in the yellow box, and I find that the memory is still very different.
image

f@f:~/Tool$ pmap -x 253367
253367:   /home/f/Tool/nvim/usr/bin/nvim --embed tiovx/source/framework/vx_array.c
Address           Kbytes     RSS   Dirty Mode  Mapping
000055ee7a86c000     572     508       0 r---- nvim
000055ee7a8fb000    3448    3448       0 r-x-- nvim
000055ee7ac59000    1124     796       0 r---- nvim
000055ee7ad72000     100     100     100 r---- nvim
000055ee7ad8b000      76      68      68 rw--- nvim
000055ee7ad9e000     100      88      88 rw---   [ anon ]
000055ee7c1d4000     148     148       4 rw--- nvim
000055ee7d94a000    6580    6432    6432 rw---   [ anon ]
000055eead530000     320     264     264 r-x--   [ anon ]
00007fd228000000     260     240     240 rw---   [ anon ]
00007fd228041000   65276       0       0 -----   [ anon ]
00007fd22e241000    5120    5120    5120 rw---   [ anon ]
00007fd22e741000       4       0       0 -----   [ anon ]
00007fd22e742000    8192       8       8 rw---   [ anon ]
00007fd22ef42000       4       0       0 -----   [ anon ]
00007fd22ef43000    8192       8       8 rw---   [ anon ]
00007fd22f743000       4       0       0 -----   [ anon ]
00007fd22f744000    8192       8       8 rw---   [ anon ]
00007fd22ff44000       4       0       0 -----   [ anon ]
00007fd22ff45000   10368    2192    2192 rw---   [ anon ]
00007fd230968000    6912    6860    6860 rw---   [ anon ]
00007fd231028000      12      12       0 r---- c.so
00007fd23102b000     100      96       0 r-x-- c.so
00007fd231044000     352     352       0 r---- c.so
00007fd23109c000       4       0       0 ----- c.so
00007fd23109d000       4       4       4 r---- c.so
00007fd23109e000       4       4       4 rw--- c.so
00007fd23109f000    1408    1408    1408 rw---   [ anon ]
00007fd231200000    2048    2048    2048 rw---   [ anon ]
00007fd231400000   14236     704       0 r---- locale-archive
00007fd232200000     160     160       0 r---- libc.so.6
00007fd232228000    1620    1344       0 r-x-- libc.so.6
00007fd2323bd000     352     184       0 r---- libc.so.6
00007fd232415000      16      16      16 r---- libc.so.6
00007fd232419000       8       8       8 rw--- libc.so.6
00007fd23241b000      52      24      24 rw---   [ anon ]
00007fd23242c000    1892    1888    1888 rw---   [ anon ]
00007fd232605000       4       4       0 r---- libutil.so.1
00007fd232606000       4       4       0 r-x-- libutil.so.1
00007fd232607000       4       0       0 r---- libutil.so.1
00007fd232608000       4       4       4 r---- libutil.so.1
00007fd232609000       4       4       4 rw--- libutil.so.1
00007fd23260a000       8       8       8 rw---   [ anon ]
00007fd23260c000      12      12       0 r---- libgcc_s.so.1
00007fd23260f000      92      88       0 r-x-- libgcc_s.so.1
00007fd232626000      16      16       0 r---- libgcc_s.so.1
00007fd23262a000       4       4       4 r---- libgcc_s.so.1
00007fd23262b000       4       4       4 rw--- libgcc_s.so.1
00007fd23262c000       4       4       0 r---- libdl.so.2
00007fd23262d000       4       4       0 r-x-- libdl.so.2
00007fd23262e000       4       0       0 r---- libdl.so.2
00007fd23262f000       4       4       4 r---- libdl.so.2
00007fd232630000       4       4       4 rw--- libdl.so.2
00007fd232631000       4       4       0 r---- libpthread.so.0
00007fd232632000       4       4       0 r-x-- libpthread.so.0
00007fd232633000       4       0       0 r---- libpthread.so.0
00007fd232634000       4       4       4 r---- libpthread.so.0
00007fd232635000       4       4       4 rw--- libpthread.so.0
00007fd232636000      56      56       0 r---- libm.so.6
00007fd232644000     496     228       0 r-x-- libm.so.6
00007fd2326c0000     364      60       0 r---- libm.so.6
00007fd23271b000       4       4       4 r---- libm.so.6
00007fd23271c000       4       4       4 rw--- libm.so.6
00007fd232722000      16       0       0 rw-s-   [ anon ]
00007fd232726000      12       0       0 rw-s-   [ anon ]
00007fd232729000       4       0       0 rw-s-   [ anon ]
00007fd23272a000       4       0       0 rw-s-   [ anon ]
00007fd23272b000      16       0       0 rw-s-   [ anon ]
00007fd23272f000      12       0       0 rw-s-   [ anon ]
00007fd232732000       4       0       0 rw-s-   [ anon ]
00007fd232733000       8       8       8 rw---   [ anon ]
00007fd232735000       8       8       0 r---- ld-linux-x86-64.so.2
00007fd232737000     168     168       0 r-x-- ld-linux-x86-64.so.2
00007fd232761000      44      40       0 r---- ld-linux-x86-64.so.2
00007fd23276c000       4       0       0 rw-s-   [ anon ]
00007fd23276d000       8       8       8 r---- ld-linux-x86-64.so.2
00007fd23276f000       8       8       8 rw--- ld-linux-x86-64.so.2
00007ffecc98d000     192     188     188 rw---   [ stack ]
00007ffecc9dd000      16       0       0 r----   [ anon ]
00007ffecc9e1000       8       4       0 r-x--   [ anon ]
ffffffffff600000       4       0       0 --x--   [ anon ]
---------------- ------- ------- ------- 
total kB          148920   35504   27052
f@f:~/Tool$ pmap -x 253360
253360:   /home/f/Tool/nvim/usr/bin/nvim --embed --clean tiovx/source/framework/vx_array.c
Address           Kbytes     RSS   Dirty Mode  Mapping
000055b8c9b40000      64      16      16 r-x--   [ anon ]
000055b8e8110000     572     572       0 r---- nvim
000055b8e819f000    3448    3384       0 r-x-- nvim
000055b8e84fd000    1124     704       0 r---- nvim
000055b8e8616000     100     100     100 r---- nvim
000055b8e862f000      76      68      68 rw--- nvim
000055b8e8642000     100      84      84 rw---   [ anon ]
000055b8e9a78000     148     148       4 rw--- nvim
000055b8ea28c000    1108    1040    1040 rw---   [ anon ]
00007f61c8935000     812     716     716 rw---   [ anon ]
00007f61c8a00000   14236     704       0 r---- locale-archive
00007f61c9800000     160     160       0 r---- libc.so.6
00007f61c9828000    1620    1344       0 r-x-- libc.so.6
00007f61c99bd000     352     184       0 r---- libc.so.6
00007f61c9a15000      16      16      16 r---- libc.so.6
00007f61c9a19000       8       8       8 rw--- libc.so.6
00007f61c9a1b000      52      24      24 rw---   [ anon ]
00007f61c9a31000     696     692     692 rw---   [ anon ]
00007f61c9adf000       4       4       0 r---- libutil.so.1
00007f61c9ae0000       4       4       0 r-x-- libutil.so.1
00007f61c9ae1000       4       0       0 r---- libutil.so.1
00007f61c9ae2000       4       4       4 r---- libutil.so.1
00007f61c9ae3000       4       4       4 rw--- libutil.so.1
00007f61c9ae4000       8       8       8 rw---   [ anon ]
00007f61c9ae6000      12      12       0 r---- libgcc_s.so.1
00007f61c9ae9000      92      92       0 r-x-- libgcc_s.so.1
00007f61c9b00000      16      16       0 r---- libgcc_s.so.1
00007f61c9b04000       4       4       4 r---- libgcc_s.so.1
00007f61c9b05000       4       4       4 rw--- libgcc_s.so.1
00007f61c9b06000       4       4       0 r---- libdl.so.2
00007f61c9b07000       4       4       0 r-x-- libdl.so.2
00007f61c9b08000       4       0       0 r---- libdl.so.2
00007f61c9b09000       4       4       4 r---- libdl.so.2
00007f61c9b0a000       4       4       4 rw--- libdl.so.2
00007f61c9b0b000       4       4       0 r---- libpthread.so.0
00007f61c9b0c000       4       4       0 r-x-- libpthread.so.0
00007f61c9b0d000       4       0       0 r---- libpthread.so.0
00007f61c9b0e000       4       4       4 r---- libpthread.so.0
00007f61c9b0f000       4       4       4 rw--- libpthread.so.0
00007f61c9b10000      56      56       0 r---- libm.so.6
00007f61c9b1e000     496     244       0 r-x-- libm.so.6
00007f61c9b9a000     364       0       0 r---- libm.so.6
00007f61c9bf5000       4       4       4 r---- libm.so.6
00007f61c9bf6000       4       4       4 rw--- libm.so.6
00007f61c9c05000      16       0       0 rw-s-   [ anon ]
00007f61c9c09000      12       0       0 rw-s-   [ anon ]
00007f61c9c0c000       4       0       0 rw-s-   [ anon ]
00007f61c9c0d000       8       8       8 rw---   [ anon ]
00007f61c9c0f000       8       8       0 r---- ld-linux-x86-64.so.2
00007f61c9c11000     168     168       0 r-x-- ld-linux-x86-64.so.2
00007f61c9c3b000      44      40       0 r---- ld-linux-x86-64.so.2
00007f61c9c46000       4       0       0 rw-s-   [ anon ]
00007f61c9c47000       8       8       8 r---- ld-linux-x86-64.so.2
00007f61c9c49000       8       8       8 rw--- ld-linux-x86-64.so.2
00007ffecfc6e000     132      44      44 rw---   [ stack ]
00007ffecfcf3000      16       0       0 r----   [ anon ]
00007ffecfcf7000       8       4       0 r-x--   [ anon ]
ffffffffff600000       4       0       0 --x--   [ anon ]
---------------- ------- ------- ------- 
total kB           26252   10744    2884

@GeekerFeng
Copy link
Author

But I only enter this one command, why are there two processes?
nvim --clean tiovx/source/framework/vx_array.c

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Sep 15, 2023

the short answer is the --embed process is spawn for the non-embed host process for editing on current embedded terminal.( i might be wrong

if u use process monitor tool like btop and enable tree view, u'll see the relation between two processes.

image

@Jint-lzxy
Copy link
Collaborator

the short answer is the --embed process is spawn for the non-embed host process for editing on current embedded terminal.

Long answer: neovim/neovim#10071 (or neovim/neovim#18375)

@ayamir
Copy link
Owner

ayamir commented Sep 30, 2023

So can I close it now?

@Jint-lzxy
Copy link
Collaborator

I think we're still missing some information (mainly a reliable repro / memory map) from the author.

@CharlesChiuGit
Copy link
Collaborator

this might provide some insights.

https://reddit.com/r/neovim/s/MmTej8T0Uc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform:linux question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants