Does model weight affect batch size?

I am using the same model but using different pretrained weights.
When A weight is used, the batch size is 48, whereas when B weight is used, out-of-memory occurs when 4 or more is used. Except for torch.load, the other code is exactly the same.
Why is this problem occurring?

No, this should not happen since each parameter would still take the same amount of memory.
Would it be possible to share a minimal and executable code snippet to reproduce the issue?