MID Server out-of-memory error during pattern output probe executionIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Troubleshoot a Management, Instrumentation, and Discovery (MID) Server out-of-memory (OOM) error that occurs during pattern output probe execution, causing the MID Server to restart or go down. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All Supported Releases Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } The MID Server is configured by default with a 1 GB Java Virtual Machine (JVM) heap. During pattern output probe execution, the GetCITypes API call from the MID Server to the instance can consume nearly all available heap memory when a large number of custom tables exist. This causes an OOM error and restarts the MID Server. The following error appears in the MID Server logs during pattern output probe execution: 2025-12-30T22:55:39.699+0530 ERROR (Worker-Expedited:HorizontalDiscoveryProbe-1d15d90f47c23e102b2afa3c416d43d9) [PriorityThreadPoolProvider$PriorityThreadPoolExecutor:461] Thread: Worker-Expedited:HorizontalDiscoveryProbe-1d15d90f47c23e102b2afa3c416d43d9 terminated abnormallyjava.lang.OutOfMemoryError: Java heap spaceat java.base/java.util.HashMap.resize(HashMap.java:702)at java.base/java.util.HashMap.putVal(HashMap.java:661)at java.base/java.util.HashMap.put(HashMap.java:610)at com.snc.sw.kb.PatternLibraryEntity.addAttribute(PatternLibraryEntity.java:136)at com.snc.sw.kb.PatternLibraryLoader.parseCiTypesJson(PatternLibraryLoader.java:271)at com.snc.sw.kb.PatternLibraryLoader.fromJson(PatternLibraryLoader.java:147)at com.snc.sw.kb.PatternLibraryLoader.loadCITypes(PatternLibraryLoader.java:75)at com.snc.sw.kb.PatternLibraryLoader.load(PatternLibraryLoader.java:58)at com.snc.sw.kb.MidPatternLibrary.init(MidPatternLibrary.java:150)at com.snc.sw.kb.MidPatternLibrary.getPatternLibrary(MidPatternLibrary.java:41)at com.snc.sw.context.ExecutionContextFactory.initialize(ExecutionContextFactory.java:93)at com.snc.sw.context.ExecutionContextFactory.createImpl(ExecutionContextFactory.java:80)at com.snc.sw.context.ExecutionContextFactory.create(ExecutionContextFactory.java:67)at com.snc.sw.context.ExecutionContextFactory.create(ExecutionContextFactory.java:63)at com.snc.sw.context.ExecutionContextFactory.create(ExecutionContextFactory.java:59)at com.snc.sw.context.ExecutionContextFactory.createAppDiscovery(ExecutionContextFactory.java:210)at com.snc.sw.context.ExecutionContextFactory.createAppDiscovery(ExecutionContextFactory.java:222)at com.snc.sw.context.ExecutionContextFactory.createAppDiscovery(ExecutionContextFactory.java:228)at com.service_now.mid.probe.HorizontalDiscoveryProbe.runProbe(HorizontalDiscoveryProbe.java:170)at com.service_now.mid.probe.ServiceWatchProbe.probe(ServiceWatchProbe.java:40)at com.service_now.mid.probe.AProbe.process(AProbe.java:160)at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:187)at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:643)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)at java.base/java.lang.Thread.run(Thread.java:840)----------------------------------------You can also observe the spike in "used" field of the 'LogStatusMonitor' in the MID Server logs even when single pattern output probe is being processed by the MID Server:2025-12-30T22:39:55.850+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:09:55.838Z, stats threads: 107, memory max: 910.0mb, allocated: 262.0mb, used: 94.0mb, standard.queued: 0 probes, standard.processing: 1 probes, expedited.queued: 0 probes, expedited.processing: 0 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:41:25.860+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:11:19.129Z, stats threads: 105, memory max: 910.0mb, allocated: 551.0mb, used: 91.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:42:16.332+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:12:16.322Z, stats threads: 106, memory max: 910.0mb, allocated: 116.0mb, used: 56.0mb, standard.queued: 0 probes, standard.processing: 1 probes, expedited.queued: 0 probes, expedited.processing: 0 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:43:16.521+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:13:16.521Z, stats threads: 106, memory max: 910.0mb, allocated: 696.0mb, used: 538.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:44:39.356+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:14:30.405Z, stats threads: 105, memory max: 910.0mb, allocated: 854.0mb, used: 746.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:45:35.236+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:15:28.393Z, stats threads: 105, memory max: 910.0mb, allocated: 854.0mb, used: 746.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:46:17.845+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:16:17.845Z, stats threads: 106, memory max: 910.0mb, allocated: 860.0mb, used: 743.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:48:20.758+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:17:32.129Z, stats threads: 105, memory max: 910.0mb, allocated: 854.0mb, used: 746.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 1 probes2025-12-30T22:55:39.782+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:25:39.781Z, stats threads: 105, memory max: 910.0mb, allocated: 490.0mb, used: 92.0mb, standard.queued: 0 probes, standard.processing: 0 probes, expedited.queued: 0 probes, expedited.processing: 1 probes, interactive.queued: 0 probes, interactive.processing: 0 probes2025-12-30T22:56:42.449+0530 INFO (LogStatusMonitor.60) [LogStatusMonitor:54] 2025-12-30T17:26:42.433Z, stats threads: 110, memory max: 910.0mb, allocated: 194.0mb, used: 99.0mb, standard.queued: 0 probes, standard.processing: 6 probes, expedited.queued: 0 probes, expedited.processing: 0 probes, interactive.queued: 0 probes, interactive.processing: 0 probes---------------------------------------- Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Increase the MID Server JVM heap memory from the default 1 GB (for example, to 4 GB or 8 GB): Log in to the MID Server host machine.Stop the MID Server service.Go to <MID_Install_Path>\agent\conf\ and open the wrapper-override.conf file.Locate the following line and uncomment it. Set the value to 4096 (4 GB) or 8192 (8 GB) based on the host machine's available memory. #wrapper.java.maxmemory=1024 5. Save the file and restart the MID Server Service. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Set the MID Server JVM memory size