Skip to main content
1-Visitor
August 7, 2017
Solved

GetJson() returns me java heap space issue

  • August 7, 2017
  • 1 reply
  • 2625 views

I have got one Thing in which i have written "ABC" service. In "ABC" service, am calling GetJSON() method which contains history url in params. As this history web service returns huge data so after few seconds this "ABC" service gives me java heap space issue.

Am calling this service from Fiddler rest client(as a rest api call) and response 500 "java heap space" is shown in fiddler.

params = {

   url: "http://178.21.406.842/api/GetHistoricalDataByAttributes?"+encodeURI(queryParams)

};

var historicJson = Resources["ContentLoaderFunctions"].GetJSON(params);

Can anyone please tell me any changes need to be made in configuration anywhere which i have missed to solve this issue?

Also in some cases data is retrieved from above url but it takes lot of time like 4minutes so how i can decrease its response time in thingworx?

When i direct hit above url through rest client it takes much less time but when i call above url through thingworx service it takes lot of time.

Any solutions to optimize this issue?

Best answer by CarlesColl

Maybe the problem it's parsing the JSON itself, try GetText instead to see if the problem it's on parsing the JSON.

1 reply

1-Visitor
August 7, 2017

Maybe the problem it's parsing the JSON itself, try GetText instead to see if the problem it's on parsing the JSON.

nbhagtani1-VisitorAuthor
1-Visitor
August 8, 2017

what is difference between GetText and LoadText method?

1-Visitor
August 8, 2017

Good Question, I don't think there's much difference ( as GetXXX service equivalent to a HTTP GET service, PutXXX service it's equivalent to HTTP PUT ) as there's no Load HTTP Action and it seems the same as Get.

But if you look onto documentation ( 6.X 😞

GetText: Get text content from a URL

LoadText:  Load text content from a URL. Additional Information: If the parsing of the header fails, an exception is logged and the request execution continues.

On documentation for 7.X both descriptions are exactly the same...