You are using unmanaged resources to create bitmap from your image. GC doesn't takes care of memory allocated to unmanaged resources. You need to dispose of your memory that you are using in that method.
After you have converted your image to bitmap you need to release all the unmanaged resources.
my memory explodes 100MB EVERY TIME
As a general statement if your memory increases by 100MB doesn't means that you have a memory leak. In case of managed resources GC will collect all the memory that is collectible whenever it will feel feasible.
Your Problem: As stated in the MSDN
You are responsible for calling the GDI DeleteObject method to free the memory used by the GDI bitmap object
You need to change your code like this
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(1000, 1000)) {
IntPtr hBitmap = bmp.GetHbitmap();
try {
var source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
}
finally {
DeleteObject(hBitmap)
}
}