A question about guns: What's the relationship between barrel width and weight?

I'm trying to write a system that allows for flexible gun customization. When I look at example real-world guns, it seems like barrel widths from 5mm (.22 cal) to 20mm (12 gauge) weight about the same, but as soon as you go to 25mm everything gets much, much heavier.

Is there some extreme nonlinearity? If so, why are 150mm guns mobile with small teams of oxen?

Is it that anyone who bothers to make a 25mm gun adds other heavy features? If so, what?

Thanks from a gun newb