Upgrading memory on a Synology ds415+

I’ve had my Synology Diskstation ds415+ network attached storage device since late 2015, replacing my custom FreeNAS box. It came with 2GB of RAM, which is fine for basic file serving, but limited when running multiple applications, including Docker containers. Once applications start swapping onto the hard disks, everything starts grinding to a halt. I finally reached the breaking point on this last night when I had to reboot the NAS once more.