Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16111

Memory leak on custom Jobs if Id setted



    • Bug
    • Resolution: Invalid
    • Critical
    • None
    • 10.11.2
    • Old Core, Refactoring
    • tomcat 9
    • Hard



      I have a very strange bug, I have some custom jobs run by my XWiki extension ( some are runs through an even listener, some others through a custom endpoint )

      But by default my jobs didn't have any ID ( null ), but now I want to give them some ID to be able to use


      And actually it works well, I can access this URL and see that my jobs are finished, the very not fun fact is that even if everything seems finish, my thread is not killed, and the heap memory usage double and sometime just crash the JVM or made the wiki unusable.

      After a lot of minutes if it's not crash before, finally the memory is released sometime but not everytime.


      I can't join the memory dump rapport because it's far over 10mo.


      How to reproduce ? Honnestly it's difficult to give my code here, but If think just create an empty jobs ( which just say hello ) with an empty request ( with and without id )


      public class CustomRequest extends AbstractRequest
      Unknown macro: {     public CustomRequest(String jobType)     Unknown macro}


      an empty job class



      public class CustomJob extends AbstractJob<CustomRequest, CustomJobStatus>
      Unknown macro: {     public static final String JOB_TYPE = "customJob";   // implement required metod ... }


      then just through for exemple an event listener or an endpoint ( CustomResource ) call

      this.jobExecutor.execute(CustomJob.JOB_TYPE, customRequest);

      Try it with and without setId in the request ( I use UUID.randomUUID but I also tried with the function provided by xwiki in RequestFactory.generateJobId(String type) it doesn't change anything



      It will maybe not be easy to reproduce it, I hope maybe you will see what is the issue






            tmortagne Thomas Mortagne
            cracky5457 Axel
            0 Vote for this issue
            2 Start watching this issue