-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
RAM Footprint #62
Comments
Not only SDL but there are GL calls here and there in the demo program. I'm unsure about Windows internals and the meaning of private bytes. If it means dynamic memory, ProcessHacker perhaps also reports leaked memory that the demo program creates. I've patched the memory leak issues with SDL, and one other. It does satisfy sanitizer but valgrind still complains about memory leaks. Currently don't have enough time, but a deep look will reveal it. Here's the patch file: https://pastebin.com/SWUMNJ6q |
Microui uses about 264~kb, checked it. |
Is 'lite' setting up a different kind of GL context with less memory footprint? |
No, OpenGL isn't a user level software. The memory usage is from SDL. If you take a look in example, particularly here, you can see that in the demo SDL is initializing all its subsystem, which individually allocates memory. For example, the demo only needs video and a few basic contexts from SDL but it's initializing other contexts too, (e.g. an audio context). See: https://github.com/libsdl-org/SDL/blob/efaa58732abb3faf3900b2d93a166b955fbd8ed0/include/SDL.h#L82 Even if you only initialize the video subsystem, I don't think memory footprint will be under some KiB. |
Hi again, So, I have tried today to reduce the SDL subsystems to match with the "lite" that I am comparing with. https://github.com/rxi/lite/blob/38bd9b3326c02e43f244623f97a622b11f074415/src/main.c#L71
Then I thought that probably lite is not using opengl at all, but actually SDL with gdi.
Is there any working example on how to use microui with GDI for normal desktop applications ? |
I'm not sure about it. Lite seems to only uses SDL for handling every graphics context and SDL under the hood uses OpenGL and GDI (Graphics Device Interface on Windows). I don't think GDI is the main reason of being "lightweight" on memory. GDI is a legacy component in Windows, mainly used for 2D graphics. But again, I'm not sure how process hacker counts "Private Bytes" in this context. What's the memory usage in task manager of that application? Is that exactly same as "Private Bytes"? |
yes, gdi is legacy, but legacy-support also means high-portability, and that its associated libraries are preloaded by the OS. |
Being a minimalistic immediate mode UI, I can't understand why 30 Mb of Private RAM usage is being measured on windows with ProcessHacker.
I noted that SDL2 calls opengl, but I don't think that this is the reason here.
The editor "exi/lite" is about 8 Mb under the same conditions.
I would expect a footprint if the range of some kb.
The text was updated successfully, but these errors were encountered: