For me, space is a huge premium. Gun safe space is a high premium. I don't store many mags in it, except those that seat within pistols and take no space. I do try to fill in gaps as best as possible stuffing small items like mags in said gaps to not waste space. Most of my mags are also loaded, to again not waste space and to have them readily available loaded to not waste time at the gun range. You'd be surprised how much space is saved by loading mags with ammo, if you have a lot like some of us do.
Most of my mags go in boxes, milk crates, ammo cans, etc. And then stored in a lockable metal foot locker truck type tool box, etc. If the mags are easily confused, like pistol mags can be, they go in large zip locks labeled with caliber and gun, so not easily confused.