Project

General

Profile

Actions

Task #1902

open

Suspected metaspace memory leaks when using Groovy from workflows

Added by Petr Fišer about 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Luboš Čábelka
Category:
Workflow
Target version:
-
Start date:
10/15/2019
Due date:
% Done:

0%

Estimated time:
Owner:

Description

First encountered on a project. IdM went nuts and stopped working after hitting Metaspace boundary of 256MB. Full GCs spinning the machine, JVM paused. GCs unable to complete their work before another one started, bringing number of running GCs to thousands. Had to kill JVM. On this project, the metaspace max size was set (by default, we do not set this setting) to aforementioned 256MB.

Succesfully replicated behavior in a sandbox environment (with projspec module). All points to synchronization of roles (reading simple database table and creating/updating roles in the IdM). This synchronization, in our project-specific implementation, uses workflows with Groovy scripts. Those Groovy scripts call some internals of IdM.
When running synchronization without workflows, the problem does not arise.

We should dig on it a bit more to find out if this is a general workflow+groovy problem. Right now, we believe it to be a product issue.
Next step is to replace wf+groovy with wf+SpEL invocations.

Lubos, can you look at this please?

Actions #1

Updated by Petr Fišer about 5 years ago

  • Description updated (diff)
Actions #2

Updated by Radek Tomiška about 5 years ago

Try to set VM parameters just for test:

-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled

this setting could enable class unloading.

Actions #3

Updated by Alena Peterová over 4 years ago

Maybe we encountered the same thing on 9.7.11, where synchronization of AD groups runs every 6 hours and processes cca 2000 records.
The synchronization ended with errors:

javax.validation.ConstraintViolationException: Validation failed for [SysSyncItemLog], errors ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=syncActionLog, rootBeanClass=class eu.bcvsolutions.idm.acc.entity.SysSyncItemLog, messageTemplate='{javax.validation.constraints.NotNull.message}'}

But running groovy scripts (during provisioning) made the entity events stuck at the Running state, with the following message in the log:

Exception in thread "event-task-executor-5" 2020-08-05 00:08:30.502  INFO 1630 --- [task-executor-4] xxxADGetEnabled                          : Start 'xxxADGetEnabled' script.
java.lang.OutOfMemoryError: Compressed class space

But otherwise, IdM reacted well.

Unluckily, I have no more information about heap and metaspace size, because there isn't full JDK.

Actions

Also available in: Atom PDF