Stowing glass jars
M, we happen to have a locker with storage for vertical bottles such as Steve describes and it is very effective offshore...but as he notes, it consumes a lot of space and so isn''t likely to be the only answer for all those bottles of olives, mustard and such that are part of long-term provisioning.
We do use socks. (In fact, I wonder just WHERE all these socks have come from!?) We use them on spare wine bottles, and all the smaller glass bottles, and we have several larger lockers where they coexist successfully with cans. So far, lots of Caribbean miles and an Atlantic crossing, but not one broken bottle.
You''ll probably be pretty efficient in stowing cans and glass jars (no boat has ''enough'' space, it seems...) and so I think you''ll find there won''t be a lot of motion allowed between the two types of containers.
BTW we also moved to another option for wine bottles: using scraps of nonskid material such as you find in Bed, Bath & Beyond and WM. It not only works well as non-skid, e.g. at preventing small carpets from skidding around on varnished soles, but it takes up little add''l space when used to protect bottles. But it is more costly than all these old socks we seem to have!