twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.77k stars 312 forks source link

Error when loading a big journal file #17

Closed Suhail closed 13 years ago

Suhail commented 14 years ago

This happens when trying to read a large journal file for whatever reason:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at net.lag.kestrel.QItem$.unpack(QItem.scala:38) at net.lag.kestrel.Journal.readJournalEntry(Journal.scala:254) at net.lag.kestrel.Journal$$anonfun$fillReadBehind$1.apply(Journal.scala:177) at net.lag.kestrel.Journal$$anonfun$fillReadBehind$1.apply(Journal.scala:171) at scala.Option.foreach(Option.scala:94) at net.lag.kestrel.Journal.fillReadBehind(Journal.scala:171) Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

robey commented 14 years ago

how much memory did you give kestrel with -Xmx? how big is the journal file?

Suhail commented 14 years ago

Journal is massive: 140G and the memory I gave was around 7k MB

Suhail commented 14 years ago

It's odd that it didn't rotate at the default 160MB level set by my config.

robey commented 14 years ago

it should rotate at 16MB if the queue is empty, or at 160MB if there is less than 16MB of stuff in it, but if you always have a lot of stuff in the queue, it won't be able to rotate the journal. was this queue backing up?

Suhail commented 14 years ago

yes it was; basically we lost data due to it....you can't restart kestrel in that instance.

robey commented 14 years ago

you can, if you give it more memory (-Xmx) or lower "max_memory_size" which is the amount of a queue it will try to keep in memory (default 128MB).

Suhail commented 14 years ago

the journal file got to 140G and I only had 8G of memory...still failed even when I raised it.

robey commented 14 years ago

:( try turning down the max_memory_size to keep it from keeping much of the journal in memory. [but it will still take a really long time to read 140GB.]

Suhail commented 14 years ago

It's max_memory_size = 134217728 which is 128 MB =\

robey commented 14 years ago

try making it even smaller if that's a bottleneck. (it will use that much memory per queue.)

Suhail commented 14 years ago

There's only two queues though. I can try though...

robey commented 13 years ago

closing old issue.