<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#073763">Hi Pavol, you are right, almost all task are related to approvals. The cleanup task was not running and the customer ran massive assignments in the past. That's the reason why we have 14k task. After running the cleanup task we have ~4k. We will be working on that. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#073763"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#073763">Thank you for your reply !</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="arial, helvetica, sans-serif"><br><br><font color="#444444">Ing Nicolás Rossi</font><br><font color="#999999">Identicum S.A.</font><br><font color="#999999">Jorge Newbery 3226</font><br><font color="#999999">Oficina: +54 (11) 4552-3050</font></font></div><div dir="ltr"><font face="arial, helvetica, sans-serif"><font color="#999999">Móvil: +54 (911) 6041-3920<br><a href="http://www.identicum.com" target="_blank">www.identicum.com</a></font></font><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 3, 2019 at 7:40 AM Pavol Mederly <<a href="mailto:mederly@evolveum.com">mederly@evolveum.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hello Nicolas,</p>
<p>I am afraid you are right in your idea: there could be tasks
closed in midPoint repository but still marked as "running" in
Quartz.</p>
<p>Maybe the synchronizer could be rewritten to be less memory
intensive. But, honestly, I did not expect there could be an
environment with 14.000 tasks. :)</p>
<p>What are these? Are they approval tasks? Why are they so many?</p>
<p>In the near future (4.0) we will stop using tasks for approvals,
so this problem will go away by itself.</p>
<p>Best regards,<br>
</p>
<pre class="gmail-m_-7722065765478133017moz-signature" cols="72">Pavol Mederly
Software developer
<a href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre>
<div class="gmail-m_-7722065765478133017moz-cite-prefix">On 01.05.2019 0:46, Nicolas Rossi
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Hi
guys, we have found that MP can fail to start due to
memory issues if there are a lot of tasks in the db.
Looking at the logs we found that Quartz queries all the
tasks on the database and then iterates over each one
when it is initialized. That process was eating the
memory on our environment with 14.000 tasks. </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><br>
</div>
<div class="gmail_default"><font face="arial, helvetica,
sans-serif" color="#073763">I modified the </font><a href="https://github.com/Evolveum/midpoint/blob/b08206d0c0e5b3c6a7155bf7d8addbfee4672236/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/TaskSynchronizer.java#L97" style="color:rgb(7,55,99);font-family:arial,helvetica,sans-serif;font-size:small" target="_blank">TaskSynchronizer</a><font face="arial, helvetica, sans-serif" color="#073763">
class to filter closed tasks on the
'synchronizeJobStores' method and it fixed
the problem. Is there any reason to get all tasks on
this process ? Maybe because some task can be closed
on the db and running in memory ?</font></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">I
can create a PR on github if you agree with this
change. <br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Any
thoughts?</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><br>
</div>
<div>
<div dir="ltr" class="gmail-m_-7722065765478133017gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="arial,
helvetica,
sans-serif"><br>
<br>
<font color="#444444">Ing
Nicolás Rossi</font><br>
<font color="#999999">Identicum
S.A.</font><br>
<font color="#999999">Jorge
Newbery 3226</font><br>
<font color="#999999">Oficina:
+54
(11) 4552-3050</font></font></div>
<div dir="ltr"><font face="arial,
helvetica,
sans-serif"><font color="#999999">Móvil:
+54 (911)
6041-3920<br>
<a href="http://www.identicum.com" target="_blank">www.identicum.com</a></font></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="gmail-m_-7722065765478133017mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_-7722065765478133017moz-quote-pre">_______________________________________________
midPoint mailing list
<a class="gmail-m_-7722065765478133017moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a class="gmail-m_-7722065765478133017moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div>