Memory leak about wxwidgets (Issue #23061)

84 views
Skip to first unread message

fangling1993

unread,
Dec 21, 2022, 1:09:30 AM12/21/22
to wx-...@googlegroups.com, Subscribed

hello:
I repeatedly opened and closed the Message dialog through dialogs in samples using Wxwidgets, and found that the program memory kept increasing.
The environment I'm using is ubantu 20.04.1


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061@github.com>

VZ

unread,
Dec 21, 2022, 12:19:49 PM12/21/22
to wx-...@googlegroups.com, Subscribed

How do you measure the program memory? Neither ASAN nor valgrind report memory leaks (other than "once off" ones in lower level toolkit code) when using wxMessageBox().


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1361687924@github.com>

fangling1993

unread,
Dec 21, 2022, 8:36:50 PM12/21/22
to wx-...@googlegroups.com, Subscribed

How do you measure the program memory? Neither ASAN nor valgrind report memory leaks (other than "once off" ones in lower level toolkit code) when using wxMessageBox().

Check for memory growth by looking at status in proc
And instead of opening wxMessageBox().


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1362287364@github.com>

fangling1993

unread,
Dec 22, 2022, 3:48:03 AM12/22/22
to wx-...@googlegroups.com, Subscribed

Repeated open will see memory keep rising, exit completely using valgrind cannot see leaks


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1362568439@github.com>

VZ

unread,
Dec 22, 2022, 9:23:33 AM12/22/22
to wx-...@googlegroups.com, Subscribed

Sorry but what exactly are you looking at in /proc?

Also, I don't understand your second sentence at all, it looks like something is missing in it.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1362898924@github.com>

fangling1993

unread,
Dec 23, 2022, 1:04:31 AM12/23/22
to wx-...@googlegroups.com, Subscribed

Check under /proc/xxx/status
VmRSS: 79760 kB
RssAnon: 40724 kB
RssFile: 39020 KB
Found that RssAnon has been continuously rising


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1363647325@github.com>

fangling1993

unread,
Dec 23, 2022, 1:10:09 AM12/23/22
to wx-...@googlegroups.com, Subscribed

Open the Message dialog in /samples/dialogs repeatedly


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1363650988@github.com>

VZ

unread,
Dec 23, 2022, 2:17:21 PM12/23/22
to wx-...@googlegroups.com, Subscribed

I don't see it here and the numbers are much smaller for me, too: RssAnon starts at 7944 kB, then, it's true, it grows a bit for the first couple of times when I open the dialog, but quickly stabilizes at 9836 kB and doesn't change any longer even though I opened it a few dozen times (I press Ctrl+Shift+M, wait until it becomes visible, then press Esc and repeat).

I'm sorry but I don't know how to explain what you're seeing and I don't think we can do anything about it, unless you can manage to find some more information about the leak.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1364262182@github.com>

fangling1993

unread,
Dec 26, 2022, 3:45:56 AM12/26/22
to wx-...@googlegroups.com, Subscribed

I don't see it here and the numbers are much smaller for me, too: RssAnon starts at 7944 kB, then, it's true, it grows a bit for the first couple of times when I open the dialog, but quickly stabilizes at 9836 kB and doesn't change any longer even though I opened it a few dozen times (I press Ctrl+Shift+M, wait until it becomes visible, then press Esc and repeat).

I'm sorry but I don't know how to explain what you're seeing and I don't think we can do anything about it, unless you can manage to find some more information about the leak.

ubuntu 22.04.1
wayland: Memory doesn't go up all the time. Start at 56,644KB, repeat 3000 times, and stabilize at 58,848KB
X11: The memory keeps growing, starting at 44260KB and repeating about 3000 times to 107,988KB


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1365004601@github.com>

VZ

unread,
Dec 26, 2022, 10:52:08 AM12/26/22
to wx-...@googlegroups.com, Subscribed

How do you repeat it 3000 times? Maybe I didn't try enough times (I did at most 30). It would be really helpful if I could at least reproduce this, as I could then try to minimize the dialog and hopefully understand which part of it results in the leak. As long as I can't do it, I can only advise you to try doing this instead, i.e., assuming that the leak doesn't happen when showing just an empty dialog, try removing (or adding) parts of this dialog until you stop (or start) seeing the leak.

Another idea could be to rebuild wx using dmalloc or something similar and check the allocation logs.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23061/1365258087@github.com>

Reply all
Reply to author
Forward
0 new messages