dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS

Home Page:https://dirkwhoffmann.github.io/vAmiga

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

any idea as of why that is?

I have no idea at the moment. The numbers on a M2 MacBook Air are even worse. Left is v2.1, right is v1.02:

Bildschirmfoto 2022-09-12 um 07 08 37

I've also checked the app sizes. Fortunately, they didn't get out of control over time (of course they have nothing to do with memory footprint):

Bildschirmfoto 2022-09-12 um 07 14 43

commented

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...

Bildschirm­foto 2022-12-23 um 14 19 56

Memory usage is back at normal.

I've fixed the issue on the v2.2 branch, so it will be part of 2.2.1, too.

Fixed.