As the title says, I'm using Wt to build a forum. It is supposed to be part of a greater project (and in the meantime it gives me the opportunity to learn Wt better, before moving to the hardest part of the project).
The problem is that when I run the server, it requires around 1.5GB.
I'm not using at the moment images, media or other options. Only the "normal" (meaning html+text+javascript) widgets, combining them to create more complex widgets, the DBO and a lot of templates.
Does such an use of memory sound as normal for a WT application? If not, there is a way to profile the memory usage by functions, data structures and code (with percentages and so on, like we can do with time profiler)?
Apparently, according to Valgrind, I've no leaks.
==13061== Memcheck, a memory error detector
==13061== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13061== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13061== Command: ./GameServer --docroot=. --http-address 0.0.0.0 --http-port 8080
==13061== Parent PID: 13060
==13061==
==13061==
==13061== HEAP SUMMARY:
==13061== in use at exit: 111,172 bytes in 243 blocks
==13061== total heap usage: 271,492 allocs, 271,249 frees, 1,545,796,300 bytes allocated
==13061==
==13061== LEAK SUMMARY:
==13061== definitely lost: 0 bytes in 0 blocks
==13061== indirectly lost: 0 bytes in 0 blocks
==13061== possibly lost: 0 bytes in 0 blocks
==13061== still reachable: 109,820 bytes in 225 blocks
==13061== of which reachable via heuristic:
==13061== newarray : 1,536 bytes in 16 blocks
==13061== suppressed: 1,352 bytes in 18 blocks
==13061== Reachable blocks (those to which a pointer was found) are not shown.
==13061== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==13061==
==13061== For counts of detected and suppressed errors, rerun with: -v
==13061== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 18 from 18)
Edit: to reply to the question of Hayt: it does start with that much usage. While, indeed I make full and wide use of containers to momentarily save data (from DB queries, for example, but nothing that can justify so much memory, since the whole DB file at the moment is only 80kb), the usage of memory doesn't increase with time and the increase with a second user is negligible (System monitor confirms 1.4GB at the strart, after I refreshed several times the web page from user_1 and after I logged in with user_2).
Edit2: using valgrind with the massif tool, I found the problem: it was another part of the application totally unrelated to WT.