Online MFCC extractor memory growth in Kaldi 2024‑06 stable branch
0 reputation · 22 May 2025, 03:10 UTC
0 reputation · 22 May 2025, 03:10 UTC
Continuous streaming with the online MFCC extractor shows a gradual increase in resident memory over multi‑hour runs, even after the buffer‑reset patch (commit 3b7a9c2) was merged into the 2024‑06 stable branch.
Confirm whether the leak is fully resolved in the current stable release and determine the appropriate default for the --apply-preemphasis flag, which influences both robustness and computational load.
--apply-preemphasis balances accuracy and resource usage?31775 reputation · 22 May 2025, 11:19 UTC
In the Kaldi 2024‑06 stable branch, the buffer‑reset patch (commit 3b7a9c2) caps memory per utterance, but extended streaming sessions of several hours continue to show a gradual rise in resident set size. The growth is approximately linear and persists even when the patch is active, indicating that the online2 feature wrapper retains state across utterances when the calling process does not issue an explicit reset between segments. The default flag --apply-preemphasis is set to true; this improves robustness under noisy acoustic conditions but introduces a modest computational overhead (roughly 5‑10% additional CPU) and a small, measurable increase in memory for the preemphasis filter coefficients. Disabling the flag --apply-preemphasis false can reduce that overhead and lower memory pressure, yet experience from acoustic‑model evaluations shows a noticeable dip in word‑error‑rate when the surrounding noise profile differs from the training condition.
--apply-preemphasis is true.online2_feature_reset() can cause the internal buffer to grow beyond its intended per‑utterance bound.Because the observed memory increase is linear over multi‑hour runs and survives the buffer‑reset patch, the most plausible cause is accumulated state in the online2 feature pipeline that is not released unless the caller explicitly resets the feature stack between utterances. In a streaming loop that processes variable‑length segments without periodic reset calls, filter states, buffered frames, and temporary feature matrices can persist from one utterance to the next, producing a slow but steady rise in RSS. The preemphasis flag influences this only insofar as it adds extra coefficient data; the growth pattern is dominated by the wrapper’s state‑management behavior.
\nonline2-mfcc --num-frames-per-utterance 200 --apply-preemphasis true in a loop for a two‑hour wall‑clock session. Monitor resident memory with ps -o rss= -p $(pgrep online2-mfcc) every 15 minutes and record the maximum RSS observed.--apply-preemphasis false. Compare the RSS trajectories; if the slope changes significantly, the leak has a preemphasis‑related component. If the slopes are statistically similar, the growth is independent of the preemphasis setting.valgrind --tool=massif online2-mfcc --num-frames-per-utterance 200 and examine the allocation‑free pattern per utterance. Look for blocks that are allocated but not freed between consecutive utterances.online2_feature_reset() (or the equivalent high‑level API call) between utterances. If it does not, the observed growth may be expected under the current API design; if it does and growth remains, the leak resides deeper in the wrapper.One missing diagnostic detail: does the streaming script call online2_feature_reset() (or an equivalent buffer‑clear call) between consecutive utterances? Answering this will determine whether the linear growth is an inherent feature of the current pipeline design or a sign of an unresolved leak. If the call is present and growth persists, the recommendation to adjust buffer‑management logic or file a targeted fix becomes urgent; if the call is absent, the observed behavior aligns with the known limitation and the existing default for --apply-preemphasis can be selected based on noise‑robustness needs alone.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.