49
GieltjE
7y

Just created the mother of all memory leaks, 300MB/s :|

Comments
  • 9
    It's a memory geyser 😁
  • 2
    Show me your ways
  • 1
    Nice. Which technology and how?
  • 0
    C# with Magick.net, it's resizing, trimming images with proper multithreading. Haven't had time to narrow it down further as I had to leave for home just after discovery.

    Even with 32GB ram it's pretty fast in filling that.
  • 2
    That's way faster than my internet.
  • 1
    @creator yeah sorry, fiber internet and a high end cpu/ram/ssd combo will fuck up your day pretty fast....
  • 0
    End result, getting the pixel collection and forgetting to dispose it is an understandable memory leak.
  • 1
    Is it a real leak in a technical way, or is it just the gc not knowing the real size of the data?

    In some imaging libraries, the image data is in unmanaged memory and thus the managed object itself is only a few bytes with a handle. The gc may even dispose the data with the objects finalizer, but it can't know that a few small objects in memory are linked to gigabytes of data, so it may keep them alive longer than required.
    Enforcing gc is normal when working with that kind of library.
  • 0
    Looke like leak, imagemagick uses a native library and the scope of the leak is just a few lines in a sepdrate function, so if it were disposable the GC would do so every few seconds but it doesn't.

    Using the proper dispose/using statement remedies it completely.
Add Comment