vinhkhuc / JFastText

Java interface for fastText
Other
228 stars 100 forks source link

Method to unload instance #1

Closed pommedeterresautee closed 7 years ago

pommedeterresautee commented 7 years ago

It seems there is no method to unload a model to free memory. Can you please add one or give instruction on how to implement it?

Kind regards, Michael

vinhkhuc commented 7 years ago

Hi Michael, It turns out that Java's GC doesn't collect memory allocated by native calls. I've added unloadModel() to release memory.

Let me know if it works for you.

Thanks, Vinh

pommedeterresautee commented 7 years ago

Thanks, that's exactly what I was looking for. I try it tonight!

Kind regards, Michaël

pommedeterresautee commented 7 years ago

Thanks it works!

pommedeterresautee commented 7 years ago

Would it be possible to update maven?

https://search.maven.org/#artifactdetails%7Ccom.github.vinhkhuc%7Cjfasttext%7C0.1%7Cjar

vinhkhuc commented 7 years ago

Hi Michaël, I've deployed v0.2 to maven central.

Thanks, Vinh