> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Configure profiling and memory

> How to enable CPU profiling and configure maximum memory size for Itential Platform services using service configuration.

When Itential Platform starts a service (application or adapter), the service loads its configuration data at startup. Service configuration for each application or adapter is managed in the **Service Config** editor in Admin Essentials.

This page covers service configuration for profiling logs and setting maximum memory size.

## CPU profiling

Itential Platform has a built-in CPU profiler to help troubleshoot performance issues and high CPU usage. It is based on [V8 profiling](https://v8.dev/docs/profile) and [Node.js simple profiling](https://nodejs.org/en/docs/guides/simple-profiling/).

Profiling can be enabled for Itential Platform and select applications and adapters in release version 2020.1 and higher.

Do not enable profiling in production deployments. It may have a significant impact on performance.

### Before you begin

You must have write permission to the working directory to create profiling logs.

### Enable profiling for Itential Platform

**In a Docker environment**, set the following environment variable in `/docker/startContainer`:

```bash
PHCORE_PROFILING=true
```

**In a shell environment**, use the `--prof` [CLI option](https://nodejs.org/docs/latest-v10.x/api/cli.html#cli_prof):

```bash
sudo -u pronghorn node --prof server.js
```

### Enable profiling for apps and adapters

#### Open Admin Essentials

Go to **Admin Essentials**.

#### Select the service

Expand the **Applications** or **Adapters** collection in the left sidebar and select the appropriate app or adapter.

#### Open the Service Config editor

From the **Configuration** tab, toggle **Advanced View** in the upper-right to display the Service Config editor.

#### Enable profiling

Edit the service configuration to enable profiling. The example below shows profiling enabled for NSO Manager:

```json
{
  "profiling": true
}
```

#### Save and restart

Click **Save**, then restart the application or adapter for the change to take effect.

### Process profiler logs

The profiler writes data to a file in the working directory named `isolate-*-v8.log`.

To convert the log into a readable format, use the Node.js `--prof-process` [CLI option](https://nodejs.org/api/cli.html#cli_prof_process):

```bash
node --prof-process isolate-0x5589eb9afae0-v8.log > isolate-0x5589eb9afae0-v8-PRETTY.log
```

Open the resulting file in your preferred editor to inspect the profiling data.

### Remove profiler logs

After analyzing the profiling data, delete the log files to reclaim disk space.

## Maximum memory size

As memory consumption approaches its limit for a service process, use `maxOldSpaceSize` to increase the memory limit. Add it to `systemProps` in the service config by navigating to **Admin Essentials** > **Applications** > **Configuration** > **Service Config**.

| Property          | Type    | Default | Description                                                                                                                                                  |
| ----------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `maxOldSpaceSize` | Integer | `2048`  | Sets the maximum memory size (in MB) of a service's V8 old memory section. Defaults to 2 GB for all services except Workflow Engine, which defaults to 8 GB. |

Sample configuration:

```json
"systemProps": {
  "maxOldSpaceSize": 4095
}
```