Redis 2.2 is really old. You should upgrade to the most recent Redis 2.8 revision as soon as you can, or maybe wait a bit for Redis 3.0 to come out (hard to say the exact date this will happen).
Also, you may have forgotten a word, but KEYS is *not* recommended for use in production.
In terms of what is actually causing your issue, if using KEYS is increasing your memory usage, you shouldn't use it. But in Redis 2.8, the SCAN command lets you perform the equivalent of KEYS piece by piece, which should prevent memory usage spikes as you are experiencing.
And in terms of implementation on your side of things, typically the use of KEYS as part of an application signals that there is some missing piece that could be used instead, which could/would eliminate KEYS usage. This isn't always the case, but it has been the case 9 out of 10 times in posts I have seen here.
- Josiah