Comments (2)
As mentioned in the docs, loading all language models requires between 3.5 and 4.0 GB of memory. They are loaded into HashMap
s which consume a lot of memory.
In your method, you are recreating the LanguageDetector
on every request. This is costly, completely unnecessary and most likely produces the OutOfMemoryError
. Only create the LanguageDetector
instance once in a global place and reuse it throughout in your application. This should probably fix your problems.
from lingua.
Since you have not replied anymore, I'm assuming that your memory problems have been fixed. That's why I'm closing this issue now. Feel free to re-open it if my assumption is wrong. Thank you.
from lingua.
Related Issues (20)
- Lingua requires JDK 8+ instead of JDK 6+ HOT 2
- java.lang.NoSuchMethodError: 'void kotlin.jvm.internal.PropertyReference1Impl HOT 4
- run with gradle ok, but error with maven HOT 2
- Add confidence metric for single language
- Reduce resources to load language models
- Option: Other HOT 3
- Language recognition error HOT 1
- Why am I forced to specify 2 languages for the detection to work with?
- Language recognition enhancement HOT 1
- IsoCode639_1 is ambiguous HOT 2
- Bump pinned version of regex dependency
- java.lang.ExceptionInInitializerError - META-INF? HOT 9
- Bad results with Java version
- Rewrite Lingua in Java HOT 2
- Simplified & Traditional Chinese HOT 2
- French text is detected as 100% English
- Not Detecting few words in French, It is detecting as a English And Few words not detecting as English but it is English
- com.github.pemistahl.lingua.api.LanguageDetector#detectLanuguageOf NoSuchMethodError with String HOT 2
- Getting language name HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lingua.