I was really surprised how much memory my simple 3D (openGL) program is using so I looked at pmap of my process and found a lot of unneeded libraries loaded
00007fe958000000 65536 20 20 rw-s- memfd:pulseaudio (deleted)
00007fe95c000000 65536 0 0 rw-s- memfd:pulseaudio (deleted)
00007fe960000000 65536 0 0 rw-s- memfd:pulseaudio (deleted)
00007fe964000000 132 4 4 rw--- [ anon ]
00007fe964021000 65404 0 0 ----- [ anon ]
00007fe968000000 65536 0 0 rw-s- memfd:pulseaudio (deleted)
00007fe96c000000 132 4 4 rw--- [ anon ]
00007fe9947cb000 16 16 0 r---- libvorbis.so.0.4.9
00007fe9947cf000 88 64 0 r-x-- libvorbis.so.0.4.9
00007fe9947e5000 68 0 0 r---- libvorbis.so.0.4.9
00007fe9947f6000 4 0 0 ----- libvorbis.so.0.4.9
00007fe9947f7000 4 4 4 r---- libvorbis.so.0.4.9
00007fe9947f8000 4 4 4 rw--- libvorbis.so.0.4.9
00007fe9947f9000 4 0 0 ----- [ anon ]
00007fe9ac010000 12 12 0 r---- libopus.so.0.8.0
00007fe9ac013000 276 60 0 r-x-- libopus.so.0.8.0
00007fe9ac058000 76 0 0 r---- libopus.so.0.8.0
00007fe9ac06b000 4 0 0 ----- libopus.so.0.8.0
00007fe9ac06c000 4 4 4 r---- libopus.so.0.8.0
00007fe9ac06d000 4 4 4 rw--- libopus.so.0.8.0
00007fe9ac06e000 36 36 0 r---- libFLAC.so.8.3.0
00007fe9ac077000 164 64 0 r-x-- libFLAC.so.8.3.0
00007fe9ac0a0000 40 0 0 r---- libFLAC.so.8.3.0
00007fe9ac0aa000 4 0 0 ----- libFLAC.so.8.3.0
00007fe9ac0ab000 4 4 4 r---- libFLAC.so.8.3.0
00007fe9ac0ac000 4 4 4 rw--- libFLAC.so.8.3.0
00007fe9ac0ad000 80 80 0 r---- libvorbisenc.so.2.0.12
00007fe9ac0c1000 12 12 0 r-x-- libvorbisenc.so.2.0.12
00007fe9ac0c4000 476 0 0 r---- libvorbisenc.so.2.0.12
00007fe9ac13b000 112 112 112 r---- libvorbisenc.so.2.0.12
00007fe9ac157000 4 4 4 rw--- libvorbisenc.so.2.0.12
00007fe9ac158000 28 28 0 r---- libsndfile.so.1.0.31
00007fe9ac15f000 344 64 0 r-x-- libsndfile.so.1.0.31
00007fe9ac1b5000 124 0 0 r---- libsndfile.so.1.0.31
00007fe9ac1d4000 12 12 12 r---- libsndfile.so.1.0.31
00007fe9ac1d7000 4 4 4 rw--- libsndfile.so.1.0.31
00007fe9ac1d8000 8 0 0 rw--- [ anon ]
00007fe9ac1da000 84 84 0 r---- libpulsecommon-15.0.so
00007fe9ac1ef000 288 288 0 r-x-- libpulsecommon-15.0.so
00007fe9ac237000 160 100 0 r---- libpulsecommon-15.0.so
00007fe9ac25f000 12 12 12 r---- libpulsecommon-15.0.so
00007fe9ac262000 4 4 4 rw--- libpulsecommon-15.0.so
00007fe9ac263000 52 52 0 r---- libpulse.so.0.24.0
00007fe9ac270000 188 188 0 r-x-- libpulse.so.0.24.0
00007fe9ac29f000 88 64 0 r---- libpulse.so.0.24.0
00007fe9ac2b5000 8 8 8 r---- libpulse.so.0.24.0
00007fe9ac2b7000 4 4 4 rw--- libpulse.so.0.24.0
00007fe9ac2b8000 2048 0 0 rw-s- renderD128
00007fe9ac4b8000 2048 0 0 rw-s- renderD128
00007fe9ac6b8000 4 0 0 ----- [ anon ]
00007fe9b68aa000 84 84 0 r---- libvulkan.so.1.2.203
00007fe9b68bf000 248 128 0 r-x-- libvulkan.so.1.2.203
00007fe9b68fd000 128 64 0 r---- libvulkan.so.1.2.203
00007fe9b691d000 12 12 12 r---- libvulkan.so.1.2.203
00007fe9b6920000 4 4 4 rw--- libvulkan.so.1.2.203
00007fe9b6921000 8 8 0 r---- libdrm_nouveau.so.2.0.0
00007fe9b6923000 16 16 0 r-x-- libdrm_nouveau.so.2.0.0
00007fe9b6927000 8 0 0 r---- libdrm_nouveau.so.2.0.0
00007fe9b6929000 4 4 4 r---- libdrm_nouveau.so.2.0.0
00007fe9b692a000 4 4 4 rw--- libdrm_nouveau.so.2.0.0
This is just a snippet, but as you can see I have a lot of audio related libs (even though I don’t have any audio yet) and even a vulkan library. Why is that ? Is there a way to prevent that ?
Here’s ldd output just in case
linux-vdso.so.1 (0x00007ffcf01a5000)
libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0x00007f0b595b7000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f0b59473000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f0b593ed000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f0b59221000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f0b5921a000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f0b591f9000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f0b598de000)
libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f0b5913f000)
libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f0b5910c000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f0b58fca000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f0b58fa0000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f0b58f9b000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f0b58f93000)