[ 
https://issues.apache.org/jira/browse/NIFI-5770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670193#comment-16670193
 ] 

Ivan Omar Olguin Torres commented on NIFI-5770:
-----------------------------------------------

If the code fails to compile in an ISP, I see multiple attempts to compile it 
in the logs (around 300 times per minute).

Is it possible that we are getting the same memory leak due to the number of 
compilation attempts?

You can reproduce it by setting an incorrect indentation on any script, you may 
be able to see multiple errors like this:
{code:java}
2018-10-30 13:56:11,103 ERROR - o.a.n.p.script.InvokeScriptedProcessor 
InvokeScriptedProcessor[id=c61d2e40-0166-1000-ffff-ffffc870d193] Unable to load 
script: IndentationError: unindent does not match any outer indentation level 
in <script> at line number 64 at column number 4: javax.script.ScriptException: 
IndentationError: unindent does not match any outer indentation level in 
<script> at line number 64 at column number 4{code}
By the way, the outcome of this action was that NiFi became fully unresponsive.

> Memory Leak in ExecuteScript
> ----------------------------
>
>                 Key: NIFI-5770
>                 URL: https://issues.apache.org/jira/browse/NIFI-5770
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.8.0
>            Reporter: Ed Berezitsky
>            Assignee: Ed Berezitsky
>            Priority: Major
>              Labels: features, performance
>         Attachments: 3117.patch, ExecuteScriptMemLeak.xml, jython_modules.zip
>
>
> ExecuteScript with Jython engine has memory leak.
>  It uses JythonScriptEngineConfigurator class to configure jython execution 
> environment.
>  The problem is in the line:
> {code:java}
> engine.eval("sys.path.append('" + modulePath + "')");{code}
> There is no check if a module has already been added previously.
>  As a result, with each execution (onTrigger), string value of module 
> property is being appended, and never reset.
> Although InvokeScriptedProcessor uses the same engine configurator, memory 
> leak is not reproducable in it,
>  because ISP builds the engine and compile the code only once (and rebuilds 
> every time any relevant property is changed).
>  Attached:
>  * template with a flow to reproduce the bug
>  * simple python modules (to be unpacked under /tmp)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to