Skip to content
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

FAHControl (Windows) memory leak ... grows to fill virtual memory #1192

Closed
bb30994 opened this issue Apr 19, 2017 · 11 comments
Closed

FAHControl (Windows) memory leak ... grows to fill virtual memory #1192

bb30994 opened this issue Apr 19, 2017 · 11 comments
Labels
3.Component - FAHControl Reported issue relates to FAHControl. 4.OS - Windows Reported issue occurs on Windows (Windows 10, Windows 8, Windows 7).

Comments

@bb30994
Copy link

bb30994 commented Apr 19, 2017

(I though this had been reported but I can't find it. It's still true in 7.4.16)

@jcoffland jcoffland added 3.Component - FAHControl Reported issue relates to FAHControl. 4.OS - Windows Reported issue occurs on Windows (Windows 10, Windows 8, Windows 7). labels Apr 21, 2017
@jcoffland
Copy link
Member

I don't know. Was there a forum post to go with this?

@informatorius
Copy link

informatorius commented Mar 31, 2018

@jcoffland :
Looks like python has a garbage collector. So maybe it is not a memory leak but the gc just decides to not release the memory yet and a gc.collect() could help to enforce it? Or it can at least show which objects cannot be collected. Edit: Tried gc.collect() and it did not help.

If this is a gtk issue then gtksharp or other newer gtk version could be a workaround.
I currently try to build FahControl for Windows using different gtk+ versions to see if mem leakage changes. Edit: gtksharp or Glade Gtk+2 seem to help much. It has Gtk+ 2.24.23 which is newer than last gnome windows binaries 2.24.10. There the mem leak seems fixed.

Which version of gkt+ where you using to build Windows FahControl?

@informatorius
Copy link

informatorius commented Apr 1, 2018

This is how I build FahControl using Glade Gtk+ 2.24.23 on Windows 7 with Python 2.7:

  1. Download GladeGtk+2 3.8.5: http://ftp.gnome.org/pub/GNOME/binaries/win32/glade/3.8/
  2. unzip to C:\GladeGtk+2
  3. open cmd shell
  4. set path=C:\GladeGtk+2\bin;%path%
  5. cd to folder fah-control
  6. python setup.py install
  7. gui\FAHControl.exe
    => nearly no mem leak

@jcoffland
Copy link
Member

Awesome. That's what I thought was wrong. I'll build with the newer gtk. Thanks for figuring this out!

@informatorius
Copy link

informatorius commented Apr 2, 2018

Mem usage on Windows 7 64bit after 12 hours (running 2 GPU slots):

FahControl build with Glade Gtk+
initial mem: 20.740 KB
after 12 hours: 22.776 KB
=> mem leak = 122 KB per month

FAHClient 7.4.16 beta
initial mem: 13.320 KB
after 12 hours: 34.640 KB
=> mem leak = 1279 KB per month

So both leaks seem acceptable.

@jcoffland
Copy link
Member

@informatorius, I installed GladeGtk+2 3.8.5 as you suggested above. Unfortunately, it had no effect on the FAHControl build. You mention pygtk 2.24.23. Where did you find this version?

@jcoffland
Copy link
Member

jcoffland commented Apr 5, 2018

@informatorius
Copy link

informatorius commented Apr 5, 2018

Inside the C:\Program Files (x86)\Glade Gtk+2\bin folder there is the libgtk-win32-2.0-0.dll 2.24.23 and all other dlls. I see in my checklist step 6) I made a mistake. It needs to be "python setup.py install" to get the dlls copied to the fah-control folder.

"python setup.py install" then should look like this:
[...]
copying c:\Program Files (x86)\Glade Gtk+2\bin\libatk-1.0-0.dll -> gui\lib\libatk-1.0-0.dll
[...]

As I understand it is not a build issue in PyGtk but a runtime issue of gtk+ 2.24.10 for Windows. This is why it needs to be replaced by a newer version like the one provided with Glade or a custom gtk+ build like used in your referenced stackoverflow issue. (PyGTK does not change and stays at latest api version 2.24.0)


Latest of gtk+ is 2.24.32 and I could build it from source using Windows msys2. https://www.gtk.org/download/windows.php
All you need to change from the tutorial is to replace the lines

pacman -S mingw-w64-x86_64-gtk3
pacman -S mingw-w64-x86_64-python2-gobject

with the 32bit version and gtk2

pacman -S mingw-w64-i686-gtk2
pacman -S mingw-w64-i686-python2-gobject

@jcoffland
Copy link
Member

Ok, I've got the build working. Client beta forthcoming. Thanks!

@informatorius
Copy link

It is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.Component - FAHControl Reported issue relates to FAHControl. 4.OS - Windows Reported issue occurs on Windows (Windows 10, Windows 8, Windows 7).
Projects
None yet
Development

No branches or pull requests

3 participants