OutOfMemory problem with Android SDK and 2.22-legacy branch

Hello everyone,

while using the SDK in its 2.22-legacy branch in our app, when we pull data and metadata from a 2.22 DHIS2 server, we’re getting an OutOfMemory exception, that seems to come from the following api call
https://hnqis-staging.psi-mis.org/api/programs/wK0958s1bdj?fields=%2CtrackedEntity%5B%5D%2CprogramIndicators%5B*%5D%2CprogramStages%5B*%2C%21dataEntryForm%2Cprogram%5Bid%5D%2CprogramIndicators%5B*%5D%2CprogramStageSections%5B*%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2Cid%2CattributeValues%5B*%2Cattribute%5B*%5D%5D%2CoptionSet%5Bid%5D%5D%5D%2CprogramIndicators%5B*%5D%5D%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2CoptionSet%5Bid%5D%5D%5D%5D%2CprogramTrackedEntityAttributes%5B*%2CtrackedEntityAttribute%5B*%5D%5D%2C%21organisationUnits%29

I attach the complete Tomcat response.

Do you have any idea about why are we getting this problem in a 2.22 server while in an equivalent 2.20 server everything’s working fine (with the same amount of memory available for Tomcat)? Is this an api bug?

Thank you in advance

tomcat_error.txt (9.7 KB)

···

Clave pública PGP:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E

Hi Morten, all,

so, yes, in PSI we have several programs which metatadata needs to be downloaded using long API calls (throuth the DHIS2-SDK) resulting in really long json objects. But, as Ignacio said, we are getting an OutOfMemory exception in one of our servers. To give you an idea, that call generates a json object which size is about 3 MB -> it downloads the metadata of a program that contains around 100 D.Elements, each dataelement has around 10 dataelement attriibutes and the program is activated in hundreds of org. units.

The server shows the following information:

  • memoryInfo: “Mem Total in JVM: 1552 Free in JVM: 874 Max Limit: 1552”,

  • javaOpts: “-Djava.security.egd=file:/dev/./urandom -Xmx1700m -Xms1250m”

Finally, the server is running a 2.22 DHIS2 version (revision 21773)…

However, we are not getting that error if we run the same API call in other server with the same memory configuration BUT running a 2.20 version (instead of 2.22).

So, do you have an idea of what is it happening here? Maybe are we close to the limit of memory of some object that for some reason is not being throwed in 2.20 but in 2.22?. Could it be a problem related just with the 2.22 version?

Also, we are going to work with programs of above 800 Data Elements (weird, we know) so I can easly think in objetcs of above 10 MB… Could it be a problem? What is the memory configuration that we need?

Copying here again the API call: https://hnqis-staging.psi-mis.org/api/programs/wK0958s1bdj?fields=%2CtrackedEntity%5B%5D%2CprogramIndicators%5B*%5D%2CprogramStages%5B*%2C%21dataEntryForm%2Cprogram%5Bid%5D%2CprogramIndicators%5B*%5D%2CprogramStageSections%5B*%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2Cid%2CattributeValues%5B*%2Cattribute%5B*%5D%5D%2CoptionSet%5Bid%5D%5D%5D%2CprogramIndicators%5B*%5D%5D%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2CoptionSet%5Bid%5D%5D%5D%5D%2CprogramTrackedEntityAttributes%5B*%2CtrackedEntityAttribute%5B*%5D%5D%2C%21organisationUnits%29

Thanks guys!

Regards

Jose

···

On Thu, Jan 21, 2016 at 4:42 PM, Ignacio Foche nacho.foche@gmail.com wrote:

Hello everyone,

while using the SDK in its 2.22-legacy branch in our app, when we pull data and metadata from a 2.22 DHIS2 server, we’re getting an OutOfMemory exception, that seems to come from the following api call
https://hnqis-staging.psi-mis.org/api/programs/wK0958s1bdj?fields=%2CtrackedEntity%5B%5D%2CprogramIndicators%5B*%5D%2CprogramStages%5B*%2C%21dataEntryForm%2Cprogram%5Bid%5D%2CprogramIndicators%5B*%5D%2CprogramStageSections%5B*%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2Cid%2CattributeValues%5B*%2Cattribute%5B*%5D%5D%2CoptionSet%5Bid%5D%5D%5D%2CprogramIndicators%5B*%5D%5D%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2CoptionSet%5Bid%5D%5D%5D%5D%2CprogramTrackedEntityAttributes%5B*%2CtrackedEntityAttribute%5B*%5D%5D%2C%21organisationUnits%29

I attach the complete Tomcat response.

Do you have any idea about why are we getting this problem in a 2.22 server while in an equivalent 2.20 server everything’s working fine (with the same amount of memory available for Tomcat)? Is this an api bug?

Clave pública PGP:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E

Thank you in advance


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi there,

this is just to inform you (I’m sure you’re already aware however) that using the recently available build 21778, the problem disappears. Thank you for this.

Best regards.

···

2016-01-21 16:42 GMT+01:00 Ignacio Foche nacho.foche@gmail.com:

Hello everyone,

while using the SDK in its 2.22-legacy branch in our app, when we pull data and metadata from a 2.22 DHIS2 server, we’re getting an OutOfMemory exception, that seems to come from the following api call
https://hnqis-staging.psi-mis.org/api/programs/wK0958s1bdj?fields=%2CtrackedEntity%5B%5D%2CprogramIndicators%5B*%5D%2CprogramStages%5B*%2C%21dataEntryForm%2Cprogram%5Bid%5D%2CprogramIndicators%5B*%5D%2CprogramStageSections%5B*%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2Cid%2CattributeValues%5B*%2Cattribute%5B*%5D%5D%2CoptionSet%5Bid%5D%5D%5D%2CprogramIndicators%5B*%5D%5D%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2CoptionSet%5Bid%5D%5D%5D%5D%2CprogramTrackedEntityAttributes%5B*%2CtrackedEntityAttribute%5B*%5D%5D%2C%21organisationUnits%29

I attach the complete Tomcat response.

Do you have any idea about why are we getting this problem in a 2.22 server while in an equivalent 2.20 server everything’s working fine (with the same amount of memory available for Tomcat)? Is this an api bug?

Clave pública PGP:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E

Thank you in advance


Clave pública PGP:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E