You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(60) |
Jul
(35) |
Aug
(32) |
Sep
(5) |
Oct
(5) |
Nov
(58) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(114) |
Feb
(184) |
Mar
(153) |
Apr
(90) |
May
(153) |
Jun
(59) |
Jul
(24) |
Aug
(43) |
Sep
(17) |
Oct
(34) |
Nov
(11) |
Dec
(204) |
2007 |
Jan
(84) |
Feb
(119) |
Mar
(38) |
Apr
(28) |
May
(52) |
Jun
(105) |
Jul
(64) |
Aug
(67) |
Sep
(14) |
Oct
(3) |
Nov
(28) |
Dec
(55) |
2008 |
Jan
(228) |
Feb
(55) |
Mar
(30) |
Apr
(30) |
May
(15) |
Jun
(20) |
Jul
(12) |
Aug
(3) |
Sep
(13) |
Oct
(54) |
Nov
(35) |
Dec
(35) |
2009 |
Jan
(19) |
Feb
(20) |
Mar
(34) |
Apr
(4) |
May
(60) |
Jun
(25) |
Jul
(16) |
Aug
(51) |
Sep
(19) |
Oct
(62) |
Nov
(21) |
Dec
(12) |
2010 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(23) |
Jun
(13) |
Jul
(1) |
Aug
(40) |
Sep
(18) |
Oct
(21) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(17) |
Feb
(23) |
Mar
(1) |
Apr
(10) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(43) |
2012 |
Jan
(5) |
Feb
(19) |
Mar
(6) |
Apr
(24) |
May
(39) |
Jun
(83) |
Jul
(29) |
Aug
(36) |
Sep
(64) |
Oct
(55) |
Nov
(12) |
Dec
(7) |
2013 |
Jan
(17) |
Feb
(10) |
Mar
(37) |
Apr
(27) |
May
(13) |
Jun
(9) |
Jul
(7) |
Aug
(61) |
Sep
(23) |
Oct
(23) |
Nov
(30) |
Dec
(16) |
2014 |
Jan
(23) |
Feb
(13) |
Mar
(9) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(9) |
Oct
(24) |
Nov
(2) |
Dec
(14) |
2015 |
Jan
(6) |
Feb
(4) |
Mar
(17) |
Apr
|
May
(7) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(21) |
Nov
(6) |
Dec
(2) |
2016 |
Jan
(4) |
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(11) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
(1) |
16
|
17
(1) |
18
(2) |
19
(2) |
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
|
|
|
|
|
From: Hernan C. <jhe...@gm...> - 2015-11-19 21:26:03
|
Thanks, Victor. I will digest this information. By. 2015-11-19 13:49 GMT-05:00 Victor Bombi: > Hi Hernan, > luajit http://luajit.org/ is a just in time compiler (JIT) for lua, that > means that you get machine code (as in a C or C++ source compiled) from lua > which is faster (http://luajit.org/performance_x86.html) than pure Lua > virtual machine code. > Besides that, luajit gives you FFI (http://luajit.org/ext_ffi.html) which > lets you use any module (.dll or .so) that is exporting functions from Lua > directly without having to compile a Lua binding for that. > Best > victor > > > |
From: Victor B. <so...@te...> - 2015-11-19 18:49:33
|
Hi Hernan, luajit http://luajit.org/ is a just in time compiler (JIT) for lua, that means that you get machine code (as in a C or C++ source compiled) from lua which is faster (http://luajit.org/performance_x86.html) than pure Lua virtual machine code. Besides that, luajit gives you FFI (http://luajit.org/ext_ffi.html) which lets you use any module (.dll or .so) that is exporting functions from Lua directly without having to compile a Lua binding for that. Best victor ----- Original Message ----- From: Hernan Cano To: Victor Bombi Sent: Thursday, November 19, 2015 12:05 AM Subject: Re: [wxlua-users] Running a .wx.lua..... Hi, Victor. Thanks for answering. I am very interested in wxLua. If you can say me something about LuaJIT (that I could understand), I appreciate it. By. 2015-11-18 11:05 GMT-05:00 Victor Bombi: But did you know that using lua53 you loose luajit...? ----- Original Message ----- From: Hernan Cano To: undisclosed-recipients Sent: Sunday, November 15, 2015 4:15 AM Subject: [wxlua-users] Running a .wx.lua..... Hello, friends. I am initiating in wxLua, that is Lua with Widgets. I can run a .lua with lua51 and lua53. I am interested in Lua53. I can run a .wx.lua with lua51, but not with lua53, but I am interested in lua53. Can you tell me how can I run the wxLua examples in lua v5.3? Thank you. HERNAN CANO M. Systems Analyst - Programmer -------------------------------------------------------------------------- |
From: Victor B. <so...@te...> - 2015-11-18 16:05:39
|
But did you know that using lua53 you loose luajit...? ----- Original Message ----- From: Hernan Cano To: undisclosed-recipients Sent: Sunday, November 15, 2015 4:15 AM Subject: [wxlua-users] Running a .wx.lua..... confirm 2d3d812c0ac3bb262df0416eda96a24521da9475 Hello, friends. I am initiating in wxLua, that is Lua with Widgets. I can run a .lua with lua51 and lua53. I am interested in Lua53. I can run a .wx.lua with lua51, but not with lua53, but I am interested in lua53. Can you tell me how can I run the wxLua examples in lua v5.3? Thank you. HERNAN CANO M. Systems Analyst - Programmer ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ _______________________________________________ wxlua-users mailing list wxl...@li... https://lists.sourceforge.net/lists/listinfo/wxlua-users |
From: Paul K <pau...@ya...> - 2015-11-18 16:01:00
|
Hi John, I ran my sample script through valgrind and it confirmed that the leaked memory is what's being used for strings in error messages. I'm including relevant parts of valgrind reports for different error conditions, but it turned out to be leaking more memory than I thought (1.6k per error message). Since the error is generated each time there is a check for a non-existing field it adds up quickly as there is no other way to check if a field is present on wxlua object or not. I think the final error message in wxlua_wxLuaBindClass__index is unnecessary; without it it would behave exactly as Lua method/field calls behave in all other places: > wx.wxTextCtrl().Absent() [string "wx.wxTextCtrl().Absent()"]:1: attempt to call field 'Absent' (a nil value) > wx.wxTextCtrl():Absent() [string "wx.wxTextCtrl():Absent()"]:1: attempt to call method 'Absent' (a nil value) > wx.wxTextCtrl().Absent nil Here is the simple patch I'm proposing: diff --git a/wxLua/modules/wxlua/wxlbind.cpp b/wxLua/modules/wxlua/wxlbind.cpp index 105f603..2523292 100644 --- a/wxLua/modules/wxlua/wxlbind.cpp +++ b/wxLua/modules/wxlua/wxlbind.cpp @@ -227,12 +227,6 @@ int LUACALL wxlua_wxLuaBindClass__index(lua_State *L) } } - if (!found) - { - wxlua_error(L, wxString::Format(_("wxLua: Unable to call an unknown method '%s' on a '%s' type."), - lua2wx(name).c_str(), lua2wx(wxlClass ? wxlClass->name : "").c_str()).c_str()); - } - return result; } This doesn't fix the leak directly, but it eliminates one of the main cases that make the leak much more noticeable. I'm including reports for two conditions: incorrect parameters (wx.wxTextCtrl().DiscardEdits()) and non-string as the key (wx.wxTextCtrl()[{}]). They follow different branches, but leak about the same amount of memory. Paul. require "wx" local ctrl = wx.wxTextCtrl() for _ = 1, 1000 do pcall(function() return ctrl.DiscardEdits() end) end ==2610== 48,000 bytes in 1,000 blocks are definitely lost in loss record 3,788 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE85BE: wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE8736: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4B5F018: wxString::wxString(char const*, wxMBConv const&) (in /home/paul/zbs/bin/linux/x86/libwx.so) ==2610== by 0x4B605CA: lua2wx(char const*) (wxllua.h:41) ==2610== by 0x4BB7969: wxlua_luaL_typename(lua_State*, int) (wxllua.cpp:939) ==2610== by 0x4BB50D6: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:169) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 56,000 bytes in 1,000 blocks are definitely lost in loss record 3,789 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE85BE: wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE8736: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4B5F018: wxString::wxString(char const*, wxMBConv const&) (in /home/paul/zbs/bin/linux/x86/libwx.so) ==2610== by 0x4B605CA: lua2wx(char const*) (wxllua.h:41) ==2610== by 0x4BB786F: wxluaT_typename(lua_State*, int) (wxllua.cpp:925) ==2610== by 0x4BB7CE4: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 68,000 bytes in 1,000 blocks are definitely lost in loss record 3,790 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE768F: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE77BD: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4E4F2B0: reserve (string.h:1332) ==2610== by 0x4E4F2B0: Alloc (string.h:2195) ==2610== by 0x4E4F2B0: operator+(wchar_t const*, wxString const&) (string.cpp:695) ==2610== by 0x4BB7D03: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2610== by 0x804BAFF: ??? (in /usr/bin/lua5.1) ==2610== by 0x804E8F1: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 72,000 bytes in 1,000 blocks are definitely lost in loss record 3,791 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE768F: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE77BD: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4E4F1D8: reserve (string.h:1332) ==2610== by 0x4E4F1D8: Alloc (string.h:2195) ==2610== by 0x4E4F1D8: operator+(wxString const&, wchar_t const*) (string.cpp:663) ==2610== by 0x4BB7D22: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2610== by 0x804BAFF: ??? (in /usr/bin/lua5.1) ==2610== by 0x804E8F1: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 119,880 bytes in 999 blocks are definitely lost in loss record 3,792 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE768F: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE77BD: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE7B0F: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::append(wchar_t const*, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE7C25: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::operator+=(wchar_t const*) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4B979A7: wxString::operator+=(wchar_t const*) (string.h:3237) ==2610== by 0x4BADC68: wxlua_getLuaArgsMsg(lua_State*, int, int) (wxlbind.cpp:592) ==2610== by 0x4BB52D3: wxlua_argerrormsg(lua_State*, wxString const&) (wxllua.cpp:180) ==2610== by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:174) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== ==2610== 151,000 bytes in 1,000 blocks are definitely lost in loss record 3,793 of 3,796 ==2610== at 0x402C619: malloc (vg_replace_malloc.c:299) ==2610== by 0x402C79F: realloc (vg_replace_malloc.c:785) ==2610== by 0x4E4EF97: Extend (string.h:3329) ==2610== by 0x4E4EF97: wxString::AsChar(wxMBConv const&) const (string.cpp:545) ==2610== by 0x4A61573: wxCStrData::AsChar() const (string.h:4038) ==2610== by 0x4A61542: wxCStrData::operator char const*() const (string.h:166) ==2610== by 0x4BB543B: wxlua_argerrormsg(lua_State*, wxString const&) (wxllua.cpp:202) ==2610== by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:174) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 203,796 bytes in 999 blocks are definitely lost in loss record 3,794 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE768F: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_clone(std::allocator<wchar_t> const&, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE77BD: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE7D86: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::append(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x5DE7E12: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::operator+=(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4B908C1: wxString::operator+=(wxString const&) (string.h:3222) ==2610== by 0x4BB5355: wxlua_argerrormsg(lua_State*, wxString const&) (wxllua.cpp:197) ==2610== by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:174) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 292,000 bytes in 1,000 blocks are definitely lost in loss record 3,795 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:140) ==2610== by 0x4E4F028: _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1692) ==2610== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1713) ==2610== by 0x4E4F028: basic_string<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:231) ==2610== by 0x4E4F028: wxString (string.h:2271) ==2610== by 0x4E4F028: wxString::Shrink() (string.cpp:562) ==2610== by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&, char*) (string.cpp:2119) ==2610== by 0x4E517FE: wxString::DoFormatWchar(wchar_t const*, ...) (string.cpp:1893) ==2610== by 0x4BA0259: wxString wxString::Format<wxCStrData, int, wxCStrData>(wxFormatString const&, wxCStrData, int, wxCStrData) (string.h:2188) ==2610== by 0x4BB516B: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:172) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2610== ==2610== 613,536 bytes in 996 blocks are definitely lost in loss record 3,796 of 3,796 ==2610== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2610== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2610== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:140) ==2610== by 0x4E4F028: _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1692) ==2610== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1713) ==2610== by 0x4E4F028: basic_string<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:231) ==2610== by 0x4E4F028: wxString (string.h:2271) ==2610== by 0x4E4F028: wxString::Shrink() (string.cpp:562) ==2610== by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&, char*) (string.cpp:2119) ==2610== by 0x4E51739: wxString::DoPrintfWchar(wchar_t const*, ...) (string.cpp:1944) ==2610== by 0x4BBB1B6: int wxString::Printf<wxCStrData, wxCStrData, wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData, wxCStrData) (string.h:2181) ==2610== by 0x4BB53EC: wxlua_argerrormsg(lua_State*, wxString const&) (wxllua.cpp:201) ==2610== by 0x4BB51B7: wxlua_argerror(lua_State*, int, wxString const&) (wxllua.cpp:174) ==2610== by 0x4BB7D3E: wxluaT_getuserdatatype(lua_State*, int, int) (wxllua.cpp:1093) ==2610== by 0x4AAF381: wxLua_wxTextCtrl_DiscardEdits(lua_State*) (wxcore_controls.cpp:8270) ==2610== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2610== by 0x805813A: ??? (in /usr/bin/lua5.1) ==2610== ==2610== LEAK SUMMARY: ==2610== definitely lost: 1,628,352 bytes in 9,061 blocks ==2610== indirectly lost: 3,264 bytes in 75 blocks ==2610== possibly lost: 247,502 bytes in 2,140 blocks require "wx" local ctrl = wx.wxTextCtrl() for _ = 1, 1000 do pcall(function() return ctrl[{}] end) end ==2635== 36,000 bytes in 1,000 blocks are definitely lost in loss record 3,786 of 3,792 ==2635== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2635== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE85BE: wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE8736: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x4B5F018: wxString::wxString(char const*, wxMBConv const&) (in /home/paul/zbs/bin/linux/x86/libwx.so) ==2635== by 0x4B605CA: lua2wx(char const*) (wxllua.h:41) ==2635== by 0x4BB7969: wxlua_luaL_typename(lua_State*, int) (wxllua.cpp:939) ==2635== by 0x4BABB39: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== by 0x8057A00: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 56,000 bytes in 1,000 blocks are definitely lost in loss record 3,787 of 3,792 ==2635== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2635== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE85BE: wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE8736: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x4B5F018: wxString::wxString(char const*, wxMBConv const&) (in /home/paul/zbs/bin/linux/x86/libwx.so) ==2635== by 0x4B605CA: lua2wx(char const*) (wxllua.h:41) ==2635== by 0x4BABAFE: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== by 0x8057A00: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 82,000 bytes in 1,000 blocks are definitely lost in loss record 3,788 of 3,792 ==2635== at 0x402C619: malloc (vg_replace_malloc.c:299) ==2635== by 0x402C79F: realloc (vg_replace_malloc.c:785) ==2635== by 0x4E4EF97: Extend (string.h:3329) ==2635== by 0x4E4EF97: wxString::AsChar(wxMBConv const&) const (string.cpp:545) ==2635== by 0x4A61573: wxCStrData::AsChar() const (string.h:4038) ==2635== by 0x4A61542: wxCStrData::operator char const*() const (string.h:166) ==2635== by 0x4BABBFF: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== by 0x8057A00: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2635== by 0x804BAFF: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 296,000 bytes in 1,000 blocks are definitely lost in loss record 3,789 of 3,792 ==2635== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2635== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE85BE: wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x5DE8736: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x4A96C4C: wxString::wxString(char const*) (in /home/paul/zbs/bin/linux/x86/libwx.so) ==2635== by 0x4BABB7D: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:142) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== by 0x8057A00: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2635== by 0x804BAFF: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 340,000 bytes in 1,000 blocks are definitely lost in loss record 3,790 of 3,792 ==2635== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2635== by 0x5DE6386: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<wchar_t> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16) ==2635== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:140) ==2635== by 0x4E4F028: _S_construct_aux<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1692) ==2635== by 0x4E4F028: _S_construct<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.h:1713) ==2635== by 0x4E4F028: basic_string<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t> > > (basic_string.tcc:231) ==2635== by 0x4E4F028: wxString (string.h:2271) ==2635== by 0x4E4F028: wxString::Shrink() (string.cpp:562) ==2635== by 0x4E516CA: DoStringPrintfV(wxString&, wxString const&, char*) (string.cpp:2119) ==2635== by 0x4E517FE: wxString::DoFormatWchar(wchar_t const*, ...) (string.cpp:1893) ==2635== by 0x4B91292: wxString wxString::Format<wxCStrData, wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData) (string.h:2188) ==2635== by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== by 0x8057A00: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F5B7: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 424,000 bytes in 1,000 blocks are indirectly lost in loss record 3,791 of 3,792 ==2635== at 0x402C619: malloc (vg_replace_malloc.c:299) ==2635== by 0x402C79F: realloc (vg_replace_malloc.c:785) ==2635== by 0x4E52C07: wxCharTypeBuffer<wchar_t>::extend(unsigned int) (buffer.h:324) ==2635== by 0x4E52CF4: wxFormatConverterBase<wchar_t>::CopyAllBefore() (strvararg.cpp:378) ==2635== by 0x4E52D4F: wxFormatConverterBase<wchar_t>::InsertFmtChar(wchar_t) (strvararg.cpp:349) ==2635== by 0x4E52F3C: wxFormatConverterBase<wchar_t>::Convert(wchar_t const*) (strvararg.cpp:270) ==2635== by 0x4E52291: wxFormatString::AsWChar() (strvararg.cpp:643) ==2635== by 0x4A3D4EE: wxFormatString::operator wchar_t const*() const (strvararg.h:220) ==2635== by 0x4B91279: wxString wxString::Format<wxCStrData, wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData) (string.h:2188) ==2635== by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== ==2635== 436,000 (12,000 direct, 424,000 indirect) bytes in 1,000 blocks are definitely lost in loss record 3,792 of 3,792 ==2635== at 0x402C10B: operator new(unsigned int) (vg_replace_malloc.c:327) ==2635== by 0x4E52C38: wxCharTypeBuffer<wchar_t>::extend(unsigned int) (buffer.h:334) ==2635== by 0x4E52CF4: wxFormatConverterBase<wchar_t>::CopyAllBefore() (strvararg.cpp:378) ==2635== by 0x4E52D4F: wxFormatConverterBase<wchar_t>::InsertFmtChar(wchar_t) (strvararg.cpp:349) ==2635== by 0x4E52F3C: wxFormatConverterBase<wchar_t>::Convert(wchar_t const*) (strvararg.cpp:270) ==2635== by 0x4E52291: wxFormatString::AsWChar() (strvararg.cpp:643) ==2635== by 0x4A3D4EE: wxFormatString::operator wchar_t const*() const (strvararg.h:220) ==2635== by 0x4B91279: wxString wxString::Format<wxCStrData, wxCStrData>(wxFormatString const&, wxCStrData, wxCStrData) (string.h:2188) ==2635== by 0x4BABBD3: wxlua_wxLuaBindClass__index(lua_State*) (wxlbind.cpp:143) ==2635== by 0x804F1CD: ??? (in /usr/bin/lua5.1) ==2635== by 0x804F567: ??? (in /usr/bin/lua5.1) ==2635== by 0x8056783: ??? (in /usr/bin/lua5.1) ==2635== ==2635== LEAK SUMMARY: ==2635== definitely lost: 826,140 bytes in 6,067 blocks ==2635== indirectly lost: 427,264 bytes in 1,075 blocks ==2635== possibly lost: 243,262 bytes in 2,080 blocks |
From: Paul K <pau...@ya...> - 2015-11-17 00:22:59
|
Hi John, Any update on a fix for this leak? It's easy to reproduce and would be great if this could be fixed, but I can't figure out what resources are not being collected... One more detail on this; it appears to leak even on `ctrl[{}]` call, which is the shortest branch of all the checks in `wxlua_wxLuaBindClass__index` method. There is not much going on before wxlua_error call, but since it's leaking on some other errors too (for example, on wrong attribute types), I suspect it has something to do with the error handling. I also tested with both Lua 5.1 and LuaJIT and the results are the same, so it seems like it's wxlua-related. Paul. On Thu, Sep 3, 2015 at 9:13 AM, Paul K <pau...@ya...> wrote: > Hi John, > > I noticed that there is a memory leak when wxlua script checks for > non-existing properties inside pcall. For example, the following > script leaks about 5M of memory on Windows: > > require "wx" > local ctrl = wx.wxTextCtrl() > for _ = 1, 10000 do pcall(function() return ctrl.foo end) end > io.read() > > (if you are checking in TaskManager, you need to look for Lua process > under "background processes" section). > > Adding "collectgarbage" doesn't help, so the leak seems to be in the > memory allocated outside of Lua. > "pcall" is needed to avoid "wxLua: Unable to call an unknown method > 'foo' on a 'wxTextCtrl' type." If the check is for the existing > property, then there is no leak. If I cause the error in "pcall" in > some other way, there is no leak either. I don't think pcall is > causing the issue; there is probably something wrong with the cleanup > after the error. > > Do you have any idea on what may be causing this? I wouldn't worry > about it too much, but there is no way to check if the property exists > without wrapping the check into a "pcall" and leaking 0.5k per check > is a bit too much. > > As a side note, I'd prefer "obj.foo" check to return "nil" instead of > failing with an error. This would be a behavior consistent with how > fields behave for tables in Lua. > > Paul. |
From: Hernan C. <jhe...@gm...> - 2015-11-15 03:15:58
|
confirm 2d3d812c0ac3bb262df0416eda96a24521da9475 Hello, friends. I am initiating in wxLua, that is Lua with Widgets. I can run a .lua with lua51 and lua53. I am interested in Lua53. I can run a .wx.lua with lua51, but not with lua53, but I am interested in lua53. Can you tell me how can I run the wxLua examples in lua v5.3? Thank you. *HERNAN CANO M.* Systems Analyst - Programmer |