How to get the total count of Objects in JSM Assets
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When dealing with JVM heap problems in JSM Assets, its possible that the total amount of objects would be the main cause for the heap exhaustion.
The Installing Assets Documentation provides the minimum and recommended JVM heap for the matching volume of objects in JSM Assets.
This KB shares steps on how to get the total count of objects to help check if you're hitting the limits for your configured heap.
Diagnosis
Out of Memory issues where io.riada.insight.index.model.ObjectIndexImpl
objects take up most of the heap.
Solution
Via the UI
As an Insight admin navigate to Insight > Insight Object Schemas, and MANUALLY sum up the object counts.
Via the DB
In the DB - count the entries in AO_8542F1_IFJ_OBJ:
select count(*) from AO_8542F1_IFJ_OBJ;
Via the logs
When persisting index to disk (Manually or at shutdown) as well as during Insight consistency check on startup - you can see the totals in the logs.
For example, the entry below means that there are 1334 total objects in JSM Assets.
http-nio-8080-exec-6 WARN username 867x25x1 sessionid 0:0:0:0:0:0:0:1 /rest/insight/1.0/index/persist [i.r.i.index.model.InsightPersistedIndexManager] Write object cache ObjectBean on disk done..... time: 689 ms, size: 433.5 kB. Number of objects persisted: 1334
Once you get the total amount of objects, cross check it with Installing Assets Documentation to verify if your heap needs to be adjusted accordingly.