0

Jedis.keys("pattern") is returning millions of large key strings causing OutOfMemoryError. Is there anyway, I can get a paginated result or any iterable resultset?

Jedis jcRead = rmgRead.getRedisClientFromPool();
// some more code in b/w

// this is causing OutOfMemoryError as keys returned are huge
Set<String> keys = jcRead.keys("*-json");
Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
loc
  • 125
  • 1
  • 7
  • 2
    Check Jedis' documentation about using the `scan` command – Itamar Haber Jan 23 '15 at 18:33
  • 2
    To expand upon the comment from @ItamarHaber, in most circumstances retrieving keys from Redis through an application client has potential to adversely affect performance. http://redis.io/commands/KEYS – rchang Jan 23 '15 at 20:00

0 Answers0