You're misunderstanding what top
is telling you. For example:
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
5 0 1230 1 20 0 351220 9284 poll_s Sl ? 0:14 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -x
You're probably seeing the huge entry under VSZ
and thinking it's using lots of RAM. That is incorrect. The RSS
column measures RAM usage. VSZ
just measures address space, which is essentially an unlimited resource.
You have latched onto something normal and are incorrectly associating it with whatever actual problem you are having.
If it really bothers you, create a file named /etc/default/fail2ban
containing just ulimit -s 256
(or add that to the end of the file if it already exists) and restart fail2ban.
To be safe, check to make sure your system doesn't have absurdly low virtual memory limits. Sometimes people confuse virtual memory with RAM and think that they need to limit virtual memory usage. Hopefully, your system isn't administered by someone who doesn't know what they're doing and isn't using brain-damaged software like OpenVZ.