Protege Out of memory exception with example

Post Reply
gcoleman0828
Posts: 8
Joined: 09 Aug 2019, 18:26

I am running Protege 3.5 (Build 663) and trying to import the demo example (essential_baseline_v62.pprj). I keep getting the following error when trying to load it:

"ATW-EventQueue-0" java.lang.OutOfMemoryError: GC overhead limit exceeded

I am able to load the few smaller ones that come with the Protege install, just not the examples.

Any help would be greatly appreciated:
- Gregg
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi,

As you've noticed, once you have a few instances in the repository, the memory requirements increase. The good news is that allocating 2GB RAM to Protege will be plenty for repositories with thousands of instances.

To increase the memory, we need to specify the allocation to the Java environment in which Protege runs. How this is done depends on the platform that you are running on.

On Windows, you can set this via the Protege user interface via the File->Preferences->Protege.lax menu. In here, you need to set the 'lax.nl.java.option.java.heap.size.max' property (in bytes) to 2048000000 (assuming you're running in a 64-bit environment).

On a Mac, you need to update the Info.plist file that you'll find behind the application icon (assuming you launch the app via the icon). In this file, set the VMOptions to -Xms250M -Xmx2048M -XX:MaxPermSize=512m

Alternatively, if you run Protege via the batch/.sh file, then you can edit the memory settings in there. This is the approach for Linux platforms.

Full details are available in this documentation page - scroll down to the 'Protege' section

Jonathan
Essential Project Team
gcoleman0828
Posts: 8
Joined: 09 Aug 2019, 18:26

Awesome. Thank you very much. It looks like it worked!

I used the wrong tab when I was in the preferences. This is what caused the problem.

I set the item lax.nl.java.option.java.heap.size.max 2048000000 in the protege.properties, not Protege.lax where it should have been.

Thanks for the help!

Gregg
kkamana
Posts: 2
Joined: 10 Jul 2020, 17:24

Hello,

We were having the similar type of issue. I was trying to open one of the demo repositories that I downloaded from the Essential Architecture main website but it keeps giving the out of memory error. As mentioned in the article, we have already configured the memory in Protege as follows:
Start Protege. Go to File->Preferences->Protege.lax
Update the row for the property ‘lax.nl.java.option.java.heap.size.max’
This is set in bytes, so set this to 2048000000 for installs with the 64-bit Java environment.
Click OK
Restart Protege
We have also maximized the memory on the server side as well. But, the issue still persists. We are completely new to this platform so, any help will be much appreciated.

Thank you,
Kamana
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi,

2GB RAM should be plenty of memory for the sample repositories but you've mentioned that you're running a Protege Server. You will need to make sure that you have allocated enough memory for both the server instance and all of the Protege clients.

Protege server is started via a shell-script, so you will need to make sure that in addition to configuring the Protege.lax (you can do this from within Protege client itself), you must update the run_protege_server.bat [.sh] file to set the MAX_MEMORY variable. This should already be something like:

Code: Select all

# ------------------- JVM Options ------------------- 
MAX_MEMORY=-Xmx2048M -XX:MaxPermSize=512m


To provide more than 2GB, you can increase the -Xmx2048M to something like -Xmx4096M (4GB)

Make sure to restart the Protege Server for these configuration settings to take effect.

If you find that 2GB is still not enough, try increasing to 4GB

Jonathan
Essential Project Team
pjnewman
Posts: 8
Joined: 24 Jun 2020, 14:37

I'm getting the same problem with the demo repository.

I increased the max heap size in the Protégé client to 5GB, but I still get the OutOfMemoryError: PermGen space.

I'm running the application on a Windows Server 2016 VM. I made sure that the heap max size was hardened in the Protégé client's properties and lax files. The Protégé server was shut down.

In the Task Manager, I can see that the memory's at 57% (or 3.4/6.0 GB). The VM's been allocated with 6GB.

I increased the max heap to 6GB just to see whether it would consumer more memory. The Task Manager's memory's now at 60% (3.6/6.0GB)., but it failed again.

I've reset the memory back to 4GB for now while I'll await your guidance.

Thank you.
kkamana
Posts: 2
Joined: 10 Jul 2020, 17:24

Hello Jonathon,

Thank you for the response. As you mentioned, we have allocated enough memory in the server side. But, now the problem is with the Protege client. Last time when I posted, I had changed the lax.nl.java.option.java.heap.size.max to 2048000000 in Protege.lax but I recently found out that it never saved the change. It goes back to the default one i.e. 524288000 even after restarting. Also, I am doing this in virtual environment using Citrix Receiver, not sure if that makes any difference.

Does this issue effect while working on essential import utility as well? I was trying to do import settings using "server based repository" and tried with the Project that my manager created in his Protege client, I used my username and password to access but it gave an error message saying "Error accessing repository" when testing connection. We are using Essential open source multi-user mode. Please guide me if I am doing anything wrong. We appreciate your help.

Thank you so much,
Kamana
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Kamana,

The Protege client must have the memory configuration applied to each Protege client installation. When the change is made within the Protege GUI (on Windows platforms), Protege must still be restarted for the change to take effect.
That you are running it within a Citrix Receiver might be significant but the required process is the same. Make sure that the Protege client running within Citrix has rights to update its protege.lax file.

You could also try editing the protege.lax file directly with a text editor on the Citrix environment, save it and restart Protege client.

Memory is important for the Essential Import Utility, too. However, this time it is the Tomcat server that is hosting the Import Utility that must be configured to provide more memory to the run time environment.

This article on our blog describes how to configure the memory for Protege and Tomcat.

In terms of connecting the Import Utility to your Protege server, you must make sure that the URL of your Protege server is defined correctly in addition to your user name and password. The user account must be a valid account, configured in your user directory within the Protege meta project configuration.

Jonathan
Essential Project Team
rudolf
Posts: 3
Joined: 03 Aug 2018, 18:34

I just ran into the PermGen version of this error trying to load the demo repository (demojuly2018share_v69.pprj).

The PermGen space is separate from the heap space. I had to increase that by adding the JVM option in run_protege.bat:

-XX:MaxPermSize=256m
xiaoqi
Posts: 127
Joined: 09 Feb 2023, 03:33

thanks greatly, I just had same "out of memory" issue on Windows 11, and increase the heap max size solve the problem, the repo is opened.
Post Reply