memory footprint (V1.x Vs. V2.x)
mibosshard opened this issue · comments
V1.0.2 approx. 165 MB
V2.1 approx. 720 MB
any idea as of why that is?
vAmigaCore (i.e. without a frontend) doesn't use excess memory with the latest code from the dev branch. Checked with MSVC's memory usage debug tool all large (>500K) allocations are for expected things. Adding hard drives increases memory usage proportionally to the disk size(s). If this is for comparable configurations (e.g. standard HD-less A500) it's likely something in the frontend (snapshots?).
Culprit is commit d52e337.
Memory is consumed by the drop zone images. Prior to this commit, I had a separate image for df0, ..., df3, hd0, ..., hd3 in the assets folder. In this commit, I've added code to imprint the drive labels programatically (in order to reduce the number of images in the assets folder):
class func createImage(_ name: String, label: String) -> NSImage {
let img = NSImage(named: name)!.copy() as! NSImage
img.imprint(text: label, x: 235, y: 330, fontSize: 100, tint: "black")
return img
}
I guess the image are created in a very high resolution which causes the large memory footprint. I'll investigate this further...
Fixed.