Vastly different RAM usage of the same software on different Openwrt devices

Same Openwrt version (19.x) on different hardware, with similar/identical hardware specs (same amount of RAM: 128MB, but different CPU/chipset). I just noticed that uhttpd, for example, uses ~4MB on one device, but ~2MB on another. In another instance, unbound-daemon uses 46MB on one, and 43MB on another, loading the same config, with the same massive include *.conf.

Why would one care? Well, on the former device, on which everything seems to take up more RAM, opkg list-upgradable frequently fails due to "out of memory".

What could contribute to such discrepancies in memory usage by the same pkgs? Is it purely due to the different CPU architectures involved?

  • x86 vs. ARM vs. MIPS (different size of code section in ELF executables)
  • 32bit vs. 64bit (different size of pointer addresses in compiled code)
  • different feature selection at build time (low memory/low flash devices vs. devices with sufficient flash and ram)

Does "Hardware flow offloading" consume vast amount of memory? Specifically, I see an MT7621(MT7530 switch)-based device using nearly twice (~94MB) as much RAM as an ???(RTL8366S switch)-based Openwrt device (~59MB), running very similar configs. No dramatic outliers in "top" other than the few procs listed above plus "/usr/sbin/hostapd", which don't come close collectively to totaling the vast difference in RAM usage. The MT7621 having hardware flow offloading enabled is the only major difference I can recall.