Alexey Kuznetsov created IGNITE-6012:

             Summary: Improve GridJettyRestHandler.processRequest()
                 Key: IGNITE-6012
             Project: Ignite
          Issue Type: Improvement
          Components: rest
    Affects Versions: 2.1
            Reporter: Alexey Kuznetsov
            Assignee: Alexey Kuznetsov
             Fix For: 2.2

In case of large result  
private void processRequest(String act, HttpServletRequest req, 
HttpServletResponse res) {
json = jsonMapper.writeValueAsString(cmdRes)

Will fail with OOME, beacuse jsonMapper.writeValueAsString(cmdRes) internally 
will create a StringBuilder and will try to allocate large amount of memory.

This could be easily fixed by writing object directly to response output stream 
jsonMapper.writeValue(out, cmdRes);

This message was sent by Atlassian JIRA

Reply via email to