Comments (11)
You almost certainly do not want to call Gst.deinit()
- please see the documentation of this function upstream - https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-Gst.html#gst-deinit
How are you measuring that memory is not released, and what exactly is remaining in memory?
from gst1-java-core.
Hi,
Thank you for your answer.
I measure the memory running "htop" command on Linux. I use a custom gstreamer element: https://github.com/alumae/gst-kaldi-nnet2-online. It is a gstreamer module created around a text-to-speech decoder that uses the Kaldi toolkit.
All I want is to have a main class that runs continuously on a server. From this I can start new threads in which I initialize a new gstreamer pipeline and I add to it this custom speech decoder element. For this element I set some attributes that consumes a very significant amount of memory. At the end of the thread execution I want to release the memory occupied by this element. I'm almost sure the resources of this element are remaining in memory now.
from gst1-java-core.
Are you manually disposing the pipelines when you're done with them? If all the heavy memory usage is outside of the JVM heap then relying on GC to collect it might be a problem.
from gst1-java-core.
I'm not sure if I understand correctly what you mean by "manually disposing," but in the thread where I run gstreamer, when the task is done, I call something like "pipe.setState (State.NULL)" and "pipe.dispose () ".
from gst1-java-core.
Exactly that, yes! So, it's possible you've uncovered a memory leak in the bindings, or a memory leak in the custom element, or something else. Now you just need to find which. 😄 Can you monitor with VisualVM? Try seeing if there are any objects under org.freedesktop.gstreamer
being kept in memory longer than expected.
What are these attributes that you're setting? How do you set them?
from gst1-java-core.
I attach here a snippet to exemplify how I create the custom element and I set its attributes.
asr = ElementFactory.make("kaldinnet2onlinedecoder", "asr");
asr.set("nnet-mode", NNET_RECIPE_TYPE);
asr.set("use-threaded-decoder", FALSE);
asr.set("fst", DECODING_GRAPH);
asr.set("model", MODEL);
asr.set("word-syms", WORDS);
asr.set("feature-type",FEATURE_TYPE);
asr.set("mfcc-config", MFCC_CONFIG);
asr.set("ivector-extraction-config", IVECTOR_EXTRACTION_CONFIG);
asr.set("endpoint-silence-phones", SILENCE_PHONES);
asr.set("max-active", MAX_ACTIVE);
asr.set("beam", BEAM);
asr.set("lattice-beam", LATTICE_BEAM);
asr.set("acoustic-scale", ACOUSTIC_SCALE);
asr.set("lm-fst", DECODING_LM_FST);
asr.set("big-lm-const-arpa", RESCORING_LM_FST);
asr.set("phone-syms", PHONES);
asr.set("word-boundary-file", WORD_BOUNDARY);
asr.set("silent", SILENT);
asr.set("do-phone-alignment", PHONE_ALIGNMENT);
asr.set("do-endpointing", ENDPOINTING);
For example, the decoding graph (DECODING_GRAPH), acoustic model (MODEL) and the decoding / rescoring language model (DECODING_LM_FST, RESCORING_LM_FST) are quite large resources.
I will inspect the issue with Visual VM and come back with info.
from gst1-java-core.
But what Java types are MODEL, etc?
from gst1-java-core.
They are not standard Java data types. "Model" represents the path to a file created using Kaldi speech recognition toolkit.
from gst1-java-core.
They have to be a Java type of some sort! Just trying to figure out if you're passing anything in that might hold a significant amount of memory on the Java side, or whether everything is allocated by the custom element. eg. assuming a path, you're passing in something like String or URI and the custom element is loading the data?
from gst1-java-core.
Exactly, the custom element is loading the data. I just pass to it a String representing the path to resource.
from gst1-java-core.
Closing this for now. Please open another issue if you find a cause of memory leaks on our end rather than in the GStreamer plugin. Thanks, Neil
from gst1-java-core.
Related Issues (20)
- Question about multithreading with multiple pipelines. HOT 1
- Possible crash on async explicit dispose in 1.4.0 HOT 3
- How to load subtitles? Solution and example required.
- native memory still exists after Pipeline.close HOT 6
- Is it possible to have a custom thread pool to execute GstCallback (AppSink.connect) ? (question)
- How to receive each frame as its pointer(Long type) or Byte array or etc. HOT 1
- VAAPI invalid chip id or driver is being used. HOT 2
- Using GIO objects
- GType.valueOf(long) is not thead safe HOT 3
- JVM Crashes HOT 3
- What may be the reason why the pipeline cannot be created HOT 2
- Exception in thread "main" java.lang.Error: Invalid memory access HOT 2
- How to improve throughput
- WebRTCBin.createAnswer() callback not called sporadically (promise garbage collected) HOT 4
- No such Gstreamer factory: webrtcbin HOT 5
- How to get RTPSession from rtpbin
- Need to know the native pointer of a Buffer object
- Segfault in extractError function HOT 6
- gst_element_get_request_pad HOT 1
- Support for pbutils HOT 1
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 gst1-java-core.