To clarify, this has nothing to do with Java nor the backend, so changing Java versions or heap space won’t have an impact. This is related to how much data you can store in the local store of the web browser.
When loading data entry module, DHIS 2 will load a lot of metadata over to the browser for offline functionality purposes, in particular if you have many org units and many heavy data set forms.
A work-around is to to go to Apps > Maintenance > Org unit levels, and for the higher levels (Global, National, Province) set the max number of org units levels to something like 2. This will make sure only org units for the given number of levels relative to the user org unit will be loaded.
regards,
Lars