To keep things simple (and assuming NO stuck processes in background "chewing up" memory), here's a little trick you might want to try
.
Go into Applications folder - Utilities Folder and launch Activity Monitor.app. After this program is launched, select its System Memory panel. Notice its FREE Memory is green. Using the mouse button, select the lower Inactive Memory entry and change its color to green. Thus, both FREE and Inactive Memory are green color. Thus, giving you a good visual of remaining memory. Notice its Page out & Swap Used numbers as well.
The trick of "most optimized" memory for a specific iMac system is to install more physical memory - to force its Page out / Swap Used numbers to be 0s. At this level, the iMac has enough physical memory (because it doesn't need to page / thrash with its hard drive). If your iMac system has Page out / Swap Used > 0 values, then install more physical RAM. For example, perhaps 12 GB, 16 GB, 24 GB or perhaps max 32 GB of physical ram (based on your iMac's unique usage).
If wondering, my "typical home usage" iMac with "NO Gaming" runs best at 12 GBs of RAM. Based on visual, it might even run best at 8 GBs of max physical RAM. But, I installed total of 12 GBs instead (to allow some future demand growth). Your iMac may need 16 GBs or perhaps the max RAM amount your unique iMac can physically take.
Note: RAM is low cost these days. Thus
Always best to install as much RAM as you can afford (that will also fit inside your specific iMac). In my iMac's case, I installed 12 GBs (little more than what's really needed).
For picture of my iMac's RAM and its System Memory values, see below:
Image
Hope this helps
.