hexenq / kuroshiro

Japanese language library for converting Japanese sentence to Hiragana, Katakana or Romaji with furigana and okurigana modes supported.
https://kuroshiro.org
MIT License
833 stars 94 forks source link

Memory Leak #1

Closed kurisubrooks closed 8 years ago

kurisubrooks commented 8 years ago

Here, we observe a simple Slack Bot before calling Kuroshiro: image

And here we observe a simple Slack Bot after calling Kuroshiro: image

You can see my usage here. Any answers for why this may be happening, or how to fix this?

hexenq commented 8 years ago

Hi, kurisubrooks. Thanks for the feedback. I've checked this issue. It seems like the memory was taken by the initiation of kuromoji. Kuromoji initiates its tokenizer by extracting dictionary files to objects and mappings which may occupy quite a lot of memory. You could check the memory usage of kuromoji.js, and about 200MB or more memory will be taken by initiating process. And I also work on finding out if there is a memory leak.