You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/08/28 11:56:00 UTC
[jira] [Commented] (CAMEL-24529) camel-djl: the loaded ZooModel is never closed (native-memory leak on restart)
[ https://issues.apache.org/jira/browse/CAMEL-24529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109204#comment-18109204 ]
Claus Ibsen commented on CAMEL-24529:
-------------------------------------
Fixed via https://github.com/apache/camel/pull/25853 (commit 6fd66062e6e6). Resolving to sync JIRA status with the merged fix.
_Claude Code on behalf of Claus Ibsen_
> camel-djl: the loaded ZooModel is never closed (native-memory leak on restart)
> ------------------------------------------------------------------------------
>
> Key: CAMEL-24529
> URL: https://issues.apache.org/jira/browse/CAMEL-24529
> Project: Camel
> Issue Type: Bug
> Components: camel-ai
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.23.0
>
>
> DJL zoo predictors load a ZooModel (ModelZoo.loadModel) in their constructor, but DJLProducer has no doStop() and AbstractPredictor has no close(), so the native ZooModel (NDManager/engine memory) is never released on route stop/redeploy or CamelContext restart — a native-memory leak. The huggingface sibling cleans up (AbstractTaskPredictor.close via HuggingFaceProducer.doStop). The per-exchange Predictor objects are correctly try-with-resources; only the model is leaked.
> Fix: add close() to AbstractPredictor (closing the model), keep the predictor reference in DJLProducer, and override DJLProducer.doStop() to close it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)