Don't fall for the spec sheet scam. It's already been shown that the S8 drops apps from RAM earlier than the iPhone 7+.
iPhone doesn't do foreground split screen multitasking or background multitasking so it can get by with less RAM. Also, iPhone uses app state suspension to and from storage so it's not the same thing as utilizing RAM for app switching. On the iPhone if you put an active SSH session in the background it gets suspended then killed from RAM after 3 minutes unlike other OS' like desktop OS, Android, etc. that run indefinitely in the background.