dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
293 stars 24 forks source link

The Amiga object needs to loose weight again #811

Closed dirkwhoffmann closed 5 months ago

dirkwhoffmann commented 5 months ago

The headless app crashes because the Amiga object has grown too large (again).

It no longer crashes when, e.g., the Sampler ring buffer is shorted by 50%.

Current memory occupation:

             Amiga : 8303088 bytes
             Agnus : 25184 bytes
       AudioFilter : 832 bytes
               CIA : 1136 bytes
       ControlPort : 1648 bytes
               CPU : 2128976 bytes
            Denise : 3055952 bytes
             Drive : 672 bytes
          Keyboard : 648 bytes
            Memory : 5160 bytes
moira::Breakpoints : 64 bytes
moira::Watchpoints : 64 bytes
   moira::Debugger : 30968 bytes
      moira::Moira : 2128816 bytes
             Muxer : 2974744 bytes
             Paula : 2978600 bytes
       PixelEngine : 19480 bytes
     RemoteManager : 75088 bytes
               RTC : 552 bytes
        RetroShell : 1720 bytes
           Sampler : 710528 bytes
        SerialPort : 528 bytes
            Volume : 12 bytes
             Zorro : 504 bytes

TODO: Move some statically allocated data to the heap.

dirkwhoffmann commented 5 months ago

Utility classes Array, SortedArray, RingBuffer, SortedRingBuffer now store their data on the heap.

Size comparison:

             Amiga : 2254464 bytes
             Agnus : 22016 bytes
       AudioFilter : 832 bytes
               CIA : 1136 bytes
       ControlPort : 1648 bytes
               CPU : 2128976 bytes
            Denise : 68680 bytes
             Drive : 672 bytes
          Keyboard : 640 bytes
            Memory : 5160 bytes
moira::Breakpoints : 64 bytes
moira::Watchpoints : 64 bytes
   moira::Debugger : 30968 bytes
      moira::Moira : 2128816 bytes
             Muxer : 1696 bytes
             Paula : 5552 bytes
       PixelEngine : 17448 bytes
     RemoteManager : 2240 bytes
               RTC : 552 bytes
        RetroShell : 1720 bytes
           Sampler : 32 bytes
        SerialPort : 528 bytes
            Volume : 12 bytes
             Zorro : 504 bytes
dirkwhoffmann commented 5 months ago

Fixed in v2.5b1