My phone is a Samsung Galaxy S3 on Android 4.1.2 JellyBean. I would want to create a profile which clears memory and recent tasks when an app is closed (example: Chrome).
Is it possible to do it without root access?
I use Clean Master for this.
You can invoke separate parts of by holding the clean master button when using the launch app function.
I know this works because I have an app that crashes on startup if there is insufficient RAM. When I use this it never crashes.
I hope it helps, even after two years.
I use Advanced Task Manager and Auto-Shortcut in Tasker to Kill apps.
For your other question, you could create a variable "%Chrome=1" the first time you launch it, and only pop up the menu if the variable is set. On exit, wait a couple minutes then clear %Chrome again.
To clear ram memory You can use Greenify. It also supports non rooted phone.
Few things from the app description: