Jump to content

Memory allocation for beginner


Recommended Posts

Hello, 

to begin with, I'm a beginner when it comes to optimization/debugging.
I was looking for possible ways to find server side memory allocation, what is taking up the most/not getting cleaned(memory leak) etc. Because currently my 4 core, ch99 core + db are taking 3,5Gb of RAM.
Does anyone here have experience with jemalloc, Heaptrack, possibly Valgrind?
Which one is best to use in my position?

Honestly I've also tried

 

but I'm not too wise with the OUTPUT.

I'd be grateful for any advice and thank you in advance!🙏

Link to comment
Share on other sites

Hopefully I will manage.. not many threads about this issue anywhere

Thanks for the direction

I'm finally going somewhere(nowhere) 😆

==15740==ERROR: AddressSanitizer: heap-use-after-free on address 0x2b90a7b1 at pc 0x290c1671 bp 0xffbf8668 sp 0xffbf8240
READ of size 1 at 0x2b90a7b1 thread T0
    #0 0x290c1670  (/usr/local/lib/gcc11/libasan.so.6+0x48670)
    #1 0x290c1e7c  (/usr/local/lib/gcc11/libasan.so.6+0x48e7c)
    #2 0x8b022c9  (/usr/home/src/Srcs/Server/game/game_r41226+0x8b022c9)
    #3 0x83a326b  (/usr/home/src/Srcs/Server/game/game_r41226+0x83a326b)
    #4 0x83a7dfb  (/usr/home/src/Srcs/Server/game/game_r41226+0x83a7dfb)
    #5 0x892ffa1  (/usr/home/src/Srcs/Server/game/game_r41226+0x892ffa1)
    #6 0x8930c44  (/usr/home/src/Srcs/Server/game/game_r41226+0x8930c44)
    #7 0x89332ee  (/usr/home/src/Srcs/Server/game/game_r41226+0x89332ee)
    #8 0x80a43dc  (/usr/home/src/Srcs/Server/game/game_r41226+0x80a43dc)

0x2b90a7b1 is located 1 bytes inside of 65-byte region [0x2b90a7b0,0x2b90a7f1)
freed by thread T0 here:
    #0 0x290f6d5b  (/usr/local/lib/gcc11/libasan.so.6+0x7dd5b)
    #1 0x83a3253  (/usr/home/src/Srcs/Server/game/game_r41226+0x83a3253)
    #2 0x83a7dfb  (/usr/home/src/Srcs/Server/game/game_r41226+0x83a7dfb)
    #3 0x892ffa1  (/usr/home/src/Srcs/Server/game/game_r41226+0x892ffa1)
    #4 0x8930c44  (/usr/home/src/Srcs/Server/game/game_r41226+0x8930c44)
    #5 0x89332ee  (/usr/home/src/Srcs/Server/game/game_r41226+0x89332ee)
    #6 0x80a43dc  (/usr/home/src/Srcs/Server/game/game_r41226+0x80a43dc)
    #7 0x80a453f  (/usr/home/src/Srcs/Server/game/game_r41226+0x80a453f)

previously allocated by thread T0 here:
    #0 0x290f5f63  (/usr/local/lib/gcc11/libasan.so.6+0x7cf63)
    #1 0x8488486  (/usr/home/src/Srcs/Server/game/game_r41226+0x8488486)
    #2 0x848894b  (/usr/home/src/Srcs/Server/game/game_r41226+0x848894b)
    #3 0x847f14f  (/usr/home/src/Srcs/Server/game/game_r41226+0x847f14f)
    #4 0x83afeef  (/usr/home/src/Srcs/Server/game/game_r41226+0x83afeef)
    #5 0x892f14b  (/usr/home/src/Srcs/Server/game/game_r41226+0x892f14b)
    #6 0x8930d6b  (/usr/home/src/Srcs/Server/game/game_r41226+0x8930d6b)
    #7 0x89332ee  (/usr/home/src/Srcs/Server/game/game_r41226+0x89332ee)
    #8 0x80a43dc  (/usr/home/src/Srcs/Server/game/game_r41226+0x80a43dc)
    #9 0x80a453f  (/usr/home/src/Srcs/Server/game/game_r41226+0x80a453f)

SUMMARY: AddressSanitizer: heap-use-after-free (/usr/local/lib/gcc11/libasan.so.6+0x48670)
Shadow bytes around the buggy address:
  0x457214a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x457214b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x457214c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x457214d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x457214e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x457214f0: 00 fa fa fa fa fa[fd]fd fd fd fd fd fd fd fd fa
  0x45721500: fa fa fa fa 00 00 00 00 00 00 00 00 00 fa fa fa
  0x45721510: fa fa 00 00 00 00 00 00 00 00 00 fa fa fa fa fa
  0x45721520: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa 00 00
  0x45721530: 00 00 00 00 00 00 00 fa fa fa fa fa 00 00 00 00
  0x45721540: 00 00 00 00 00 fa fa fa fa fa 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==15740==ABORTING

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.