cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

GetJson() returns me java heap space issue

nbhagtani
2-Guest

GetJson() returns me java heap space issue

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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

what is difference between GetText and LoadText method?

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...

Top Tags