Put:
(load-module "mem")
In your ~/.stumpwmrc
~/.stumpwmrc
Then you can use "%M" and/or "%N in your mode line format.
This is specific to Linux. The %M mode line formatter is also used by the 'maildir' module.