Support #12116
openMemory doesn't seem to be properly released
0%
Description
Hi,
I'm seeing a similar memory management problem as in this post:
https://redmine.emweb.be/boards/2/topics/17817
I repeated the code in the referenced post under valgrid.
Memory usage (in kB) as seen in KDE's system monitoring application (ksysguard) is as follows:
130 064 - start application with valgrind
137 784 - session started
185 156 - button1 clicked
185 284 - button2 clicked
185 284 - session destroyed (close browser)
I don't really know valgrind, but the output doesn't seem to detect any memory mismanagement.
This is with a mockup application on x86_64. The same behaviour is seen on my ARM v7 server with a final application, where memory usage as reported by 'systemctl status <unit>' just continues to increase on each session.
Using Wt 4.10.0.
Please advise a solution.
Thank you.
------------------------------------------------------------------------------¶
$ valgrind --leak-check=yes ./v --docroot . --http-port 8081 --http-address localhost
==15596== Memcheck, a memory error detector
==15596== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==15596== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==15596== Command: ./v --docroot . --http-port 8081 --http-address localhost
==15596==
[2023-Nov-05 22:22:47.701] 15596 - [info] "config: reading Wt config file: /home/user/tmp/misc/qaddev/wt-valgrind/build/../WTAPPROOT/V/wt_config.xml (location = './v')"
[2023-Nov-05 22:22:47.806] 15596 - [info] "wthttp: reading wthttpd configuration from: /etc/wt/wthttpd"
[2023-Nov-05 22:22:47.823] 15596 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2023-Nov-05 22:22:48.563] 15596 - [info] "wthttp: started server: http://127.0.0.1:8081 (localhost)"
[2023-Nov-05 22:22:48.572] 15596 - [info] "wthttp: started server: http://[::1]:8081 (localhost)"
[2023-Nov-05 22:23:17.969] 15596 - [info] "Wt: session created (#sessions = 1)"
[2023-Nov-05 22:23:18.012] 15596 [/ Ml3EzkjQNASVdoPx] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
::1 - - [2023-Nov-05 22:23:18.269] "GET / HTTP/1.1" 200 2089
[2023-Nov-05 22:23:18.278] 15596 - [info] "WebRequest: took 363.614 ms"
::1 - - [2023-Nov-05 22:23:18.585] "GET /?wtd=Ml3EzkjQNASVdoPx&request=style&page=1 HTTP/1.1" 200 91
[2023-Nov-05 22:23:18.586] 15596 - [info] "WebRequest: took 261.132 ms"
::1 - - [2023-Nov-05 22:23:18.773] "GET /?wtd=Ml3EzkjQNASVdoPx&sid=2708153243&webGL=true&scrW=1463&scrH=823&tz=60&tzS=Europe%2FParis&htmlHistory=true&deployPath=%2F&request=script&rand=3512898829 HTTP/1.1" 200 16491
[2023-Nov-05 22:23:18.773] 15596 - [info] "WebRequest: took 401.326 ms"
::1 - - [2023-Nov-05 22:23:18.892] "GET /favicon.ico HTTP/1.1" 404 85
::1 - - [2023-Nov-05 22:23:18.892] "POST /?wtd=Ml3EzkjQNASVdoPx HTTP/1.1" 200 48
[2023-Nov-05 22:23:18.893] 15596 - [info] "WebRequest: took 46.833 ms"
::1 - - [2023-Nov-05 22:23:43.697] "POST /?wtd=Ml3EzkjQNASVdoPx HTTP/1.1" 200 27189
[2023-Nov-05 22:23:43.697] 15596 - [info] "WebRequest: took 2098.58 ms"
::1 - - [2023-Nov-05 22:24:16.518] "POST /?wtd=Ml3EzkjQNASVdoPx HTTP/1.1" 200 95
[2023-Nov-05 22:24:16.518] 15596 - [info] "WebRequest: took 1001.02 ms"
[2023-Nov-05 22:24:35.363] 15596 - [info] "WebController: Removing session Ml3EzkjQNASVdoPx"::1 - - [2023-Nov-05 22:24:35.364] "POST /?wtd=Ml3EzkjQNASVdoPx HTTP/1.1" 200 126
[2023-Nov-05 22:24:35.416] 15596 [/ Ml3EzkjQNASVdoPx] [info] "Wt: session destroyed (#sessions = 0)"
[2023-Nov-05 22:24:35.364] 15596 - [info] "WebRequest: took 19.744 ms"
^C[2023-Nov-05 22:24:56.506] 15596 - [info] "WServer/wthttp: shutdown (signal = 2)"
[2023-Nov-05 22:24:56.508] 15596 - [info] "WebController: shutdown: stopping 0 sessions."
[2023-Nov-05 22:24:56.511] 15596 - [info] "WServer/wthttp: Shutdown: stopping web server."
==15596==
==15596== HEAP SUMMARY:
==15596== in use at exit: 8,327 bytes in 20 blocks
==15596== total heap usage: 149,144 allocs, 149,124 frees, 53,624,128 bytes allocated
==15596==
==15596== LEAK SUMMARY:
==15596== definitely lost: 0 bytes in 0 blocks
==15596== indirectly lost: 0 bytes in 0 blocks
==15596== possibly lost: 0 bytes in 0 blocks
==15596== still reachable: 8,327 bytes in 20 blocks
==15596== suppressed: 0 bytes in 0 blocks
==15596== Reachable blocks (those to which a pointer was found) are not shown.
==15596== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==15596==
==15596== For lists of detected and suppressed errors, rerun with: -s
==15596== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Updated by Matthias Van Ceulebroeck about 1 year ago
- Target version set to future
Hello,
as the original post also mentions, it is very possible that your OS simply doesn't release the memory. Massif may give a better view on this.
I will take a look at this as well in the future.
Updated by S ET about 1 year ago
massif
Thank you for this very interesting link. I'll have a look as time permits.