Use the snmp-server commands (like snmp-server enable and snmp-server community etc). When the config is saved using the "write mem" command, free space in NVRAM decreases continuously (seen by issuing the "dir nvram:" command).
1024 bytes are lost every time the command is issued. If this is repeated to the point where there is no more free NVRAM left, the following warning is displayed by the switch.