Question / Help Memory leak/CPU usage keeps going up?

PandaCG

New Member
Hi, so I've been trying to play rimworld on stream and the cpu usage starts at around 3-4% (nvenc encoder, main profile, 3200 bitrate) and over the course of a few minutes the usage keeps ramping up until it hits 100%. In task manager obs does seem to be taking up all of my cpu and a ton of memory, almost more-so than the game itself. Does anyone know what causes this? Is there a fix? I streamed for 12 hours yesterday and it started happening towards the end when I booted up rimworld, every other game was fine though.

EDIT: Here is a log from my most recent stream, at the bottom I notice it says "Number of memory leaks: 25"
08:18:05.682: CPU Name: Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
08:18:05.682: CPU Speed: 3500MHz
08:18:05.682: Physical Cores: 4, Logical Cores: 4
08:18:05.682: Physical Memory: 32618MB Total, 27173MB Free
08:18:05.682: Windows Version: 10.0 Build 15063 (revision: 296; 64-bit)
08:18:05.682: Running as administrator: false
08:18:05.682: Aero is Enabled (Aero is always on for windows 8 and above)
08:18:05.682: Portable mode: false
08:18:05.694: OBS 19.0.2 (64bit, windows)
08:18:05.694: ---------------------------------
08:18:05.695: ---------------------------------
08:18:05.695: audio settings reset:
08:18:05.695: samples per sec: 44100
08:18:05.695: speakers: 2
08:18:05.707: ---------------------------------
08:18:05.707: Initializing D3D11...
08:18:05.707: Available Video Adapters:
08:18:05.708: Adapter 1: NVIDIA GeForce GTX 1080
08:18:05.708: Dedicated VRAM: 4209704960
08:18:05.708: Shared VRAM: 4216543232
08:18:05.708: output 1: pos={0, 0}, size={1920, 1080}, attached=true
08:18:05.708: output 2: pos={1920, -55}, size={1440, 900}, attached=true
08:18:05.708: Adapter 2: Intel(R) HD Graphics 4600
08:18:05.708: Dedicated VRAM: 117964800
08:18:05.708: Shared VRAM: 2147483648
08:18:05.710: Loading up D3D11 on adapter NVIDIA GeForce GTX 1080 (0)
08:18:06.178: D3D11 loaded successfully, feature level used: 45056
08:18:06.821: ---------------------------------
08:18:06.821: video settings reset:
08:18:06.821: base resolution: 1920x1080
08:18:06.821: output resolution: 1280x720
08:18:06.821: downscale filter: Lanczos
08:18:06.821: fps: 60/1
08:18:06.821: format: NV12
08:18:06.822: Audio monitoring device:
08:18:06.822: name: Default
08:18:06.822: id: default
08:18:06.822: ---------------------------------
08:18:06.878: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/chrome_elf.dll' not found, loading of module failed
08:18:06.897: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
08:18:06.910: [AMF] Encountered Exception during AMF initialization: Unable to load 'amfrt64.dll', error code 126.
08:18:06.910: Failed to initialize module 'enc-amf.dll'
08:18:06.989: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libcef.dll' not found, loading of module failed
08:18:06.997: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libEGL.dll' not found, loading of module failed
08:18:07.006: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libGLESv2.dll' not found, loading of module failed
08:18:07.017: Failed to load 'en-US' text for module: 'obs-browser.dll'
08:18:07.017: [browser_source: 'Version: 1.29.0']
08:18:07.099: NVENC supported
08:18:07.256: Couldn't find VLC installation, VLC video source disabled
08:18:07.282: No blackmagic support
08:18:07.552: ---------------------------------
08:18:07.552: Loaded Modules:
08:18:07.552: win-wasapi.dll
08:18:07.552: win-mf.dll
08:18:07.552: win-dshow.dll
08:18:07.552: win-decklink.dll
08:18:07.552: win-capture.dll
08:18:07.552: vlc-video.dll
08:18:07.552: text-freetype2.dll
08:18:07.552: rtmp-services.dll
08:18:07.552: obs-x264.dll
08:18:07.552: obs-vst.dll
08:18:07.552: obs-transitions.dll
08:18:07.552: obs-text.dll
08:18:07.552: obs-qsv11.dll
08:18:07.552: obs-outputs.dll
08:18:07.552: obs-filters.dll
08:18:07.552: obs-ffmpeg.dll
08:18:07.552: obs-browser.dll
08:18:07.552: image-source.dll
08:18:07.552: frontend-tools.dll
08:18:07.552: enc-amf.dll
08:18:07.552: coreaudio-encoder.dll
08:18:07.552: ==== Startup complete ===============================================
08:18:07.556: Switched to Preview/Program mode
08:18:07.556: ------------------------------------------------
08:18:07.557: All scene data cleared
08:18:07.557: ------------------------------------------------
08:18:07.579: WASAPI: Device 'Speakers (USB Audio Device)' initialized
08:18:07.586: WASAPI: Device 'Microphone (Blue Snowball)' initialized
08:18:07.655: adding 23 milliseconds of audio buffering, total audio buffering is now 23 milliseconds
08:18:10.460: Switched to scene 'Games'
08:18:10.462: ------------------------------------------------
08:18:10.462: Loaded scenes:
08:18:10.462: - scene 'Games':
08:18:10.462: - source: 'Game Capture' (game_capture)
08:18:10.462: - source: 'Game Event List' (browser_source)
08:18:10.462: - filter: 'Color Correction' (color_filter)
08:18:10.462: - source: 'Logo' (image_source)
08:18:10.462: - filter: 'Color Correction' (color_filter)
08:18:10.462: - source: 'Text (GDI+)' (text_gdiplus)
08:18:10.462: - scene 'AFK':
08:18:10.462: - source: 'AFK Background w/ Chat Box' (image_source)
08:18:10.462: - source: 'Top Overlay' (image_source)
08:18:10.462: - source: 'PandaCG Text Top' (text_gdiplus)
08:18:10.462: - source: 'Twitter Link Top' (text_gdiplus)
08:18:10.462: - source: 'Musical Spectrum' (window_capture)
08:18:10.462: - filter: 'Chroma Key' (chroma_key_filter)
08:18:10.462: - source: 'Chat' (browser_source)
08:18:10.462: - source: 'Event List' (browser_source)
08:18:10.462: - source: 'AFK Text' (text_gdiplus)
08:18:10.462: ------------------------------------------------
08:18:24.398: ---------------------------------
08:18:24.398: [NVENC encoder: 'simple_h264_stream'] settings:
08:18:24.398: rate_control: CBR
08:18:24.398: bitrate: 6000
08:18:24.398: cqp: 0
08:18:24.398: keyint: 120
08:18:24.398: preset: default
08:18:24.398: profile: main
08:18:24.398: level: auto
08:18:24.398: width: 1280
08:18:24.398: height: 720
08:18:24.398: 2-pass: true
08:18:24.398: b-frames: 2
08:18:24.398: GPU: 0
08:18:24.398:
08:18:24.916: [Media Foundation AAC: 'simple_aac']: encoder created
08:18:24.916: bitrate: 160
08:18:24.916: channels: 2
08:18:24.916: sample rate: 44100
08:18:24.916: bits-per-sample: 16
08:18:24.916:
08:18:24.917: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://live-dfw.twitch.tv/app...
08:18:24.941: [rtmp stream: 'simple_stream'] Interface: Intel(R) Ethernet Connection I217-V (ethernet, 1000 mbps)
08:18:26.089: [rtmp stream: 'simple_stream'] Connection to rtmp://live-dfw.twitch.tv/app successful
08:18:26.091: ==== Streaming Start ===============================================
08:18:43.067: adding 23 milliseconds of audio buffering, total audio buffering is now 46 milliseconds
08:22:31.605: [game-capture: 'Game Capture'] attempting to hook process: RimWorldWin.exe
08:22:31.607: [game-capture: 'Game Capture'] using helper (compatibility hook)
08:22:31.608: [game-capture: 'Game Capture'] hook not loaded yet, retrying..
08:22:34.622: [game-capture: 'Game Capture'] attempting to hook process: RimWorldWin.exe
08:22:38.639: [game-capture: 'Game Capture'] attempting to hook process: RimWorldWin.exe
08:22:39.167: [game-capture: 'Game Capture'] d3d9 shared texture capture successful
08:22:39.172: [game-capture: 'Game Capture'] shared texture capture successful
08:25:33.847: User switched to scene 'AFK'
08:25:55.744: User switched to scene 'Games'
08:26:42.081: User switched to scene 'AFK'
08:34:41.366: [rtmp stream: 'simple_stream'] User stopped the stream
08:34:41.366: Output 'simple_stream': stopping
08:34:41.366: Output 'simple_stream': Total encoded frames: 57435
08:34:41.366: Output 'simple_stream': Total drawn frames: 58587
08:34:41.369: ==== Streaming Stop ================================================
08:34:49.202: User switched to scene 'Games'
08:34:51.849: ==== Shutting down ==================================================
08:34:51.855: Switched to scene '(null)'
08:34:51.863: [game-capture: 'Game Capture'] capture stopped
08:34:51.865: WASAPI: Device 'Speakers (USB Audio Device)' Terminated
08:34:51.867: WASAPI: Device 'Microphone (Blue Snowball)' Terminated
08:34:51.869: All scene data cleared
08:34:51.870: ------------------------------------------------
08:34:51.927: Freeing OBS context data
08:34:52.034: == Profiler Results =============================
08:34:52.035: run_program_init: 4899.12 ms
08:34:52.035: ┣OBSApp::AppInit: 15.731 ms
08:34:52.035: ┃ ┗OBSApp::InitLocale: 4.464 ms
08:34:52.035: ┗OBSApp::OBSInit: 4849.38 ms
08:34:52.035: ┣obs_startup: 6.384 ms
08:34:52.035: ┗OBSBasic::OBSInit: 4806.26 ms
08:34:52.035: ┣OBSBasic::InitBasicConfig: 0.381 ms
08:34:52.035: ┣OBSBasic::ResetAudio: 0.57 ms
08:34:52.035: ┣OBSBasic::ResetVideo: 1125.75 ms
08:34:52.035: ┣OBSBasic::InitOBSCallbacks: 0.003 ms
08:34:52.035: ┣OBSBasic::InitHotkeys: 0.038 ms
08:34:52.035: ┣obs_load_all_modules: 730.856 ms
08:34:52.035: ┃ ┣obs_init_module(coreaudio-encoder.dll): 0.399 ms
08:34:52.035: ┃ ┣obs_init_module(enc-amf.dll): 0.411 ms
08:34:52.035: ┃ ┣obs_init_module(frontend-tools.dll): 1.281 ms
08:34:52.035: ┃ ┣obs_init_module(image-source.dll): 0.004 ms
08:34:52.035: ┃ ┣obs_init_module(obs-browser.dll): 0.047 ms
08:34:52.035: ┃ ┣obs_init_module(obs-ffmpeg.dll): 0.444 ms
08:34:52.035: ┃ ┣obs_init_module(obs-filters.dll): 0.011 ms
08:34:52.035: ┃ ┣obs_init_module(obs-outputs.dll): 0.006 ms
08:34:52.035: ┃ ┣obs_init_module(obs-qsv11.dll): 3.27 ms
08:34:52.035: ┃ ┣obs_init_module(obs-text.dll): 0.373 ms
08:34:52.035: ┃ ┣obs_init_module(obs-transitions.dll): 0.005 ms
08:34:52.035: ┃ ┣obs_init_module(obs-vst.dll): 0.002 ms
08:34:52.035: ┃ ┣obs_init_module(obs-x264.dll): 0.001 ms
08:34:52.035: ┃ ┣obs_init_module(rtmp-services.dll): 0.216 ms
08:34:52.035: ┃ ┣obs_init_module(text-freetype2.dll): 0.054 ms
08:34:52.035: ┃ ┣obs_init_module(vlc-video.dll): 0.03 ms
08:34:52.035: ┃ ┣obs_init_module(win-capture.dll): 0.063 ms
08:34:52.035: ┃ ┣obs_init_module(win-decklink.dll): 1.889 ms
08:34:52.035: ┃ ┣obs_init_module(win-dshow.dll): 1.195 ms
08:34:52.035: ┃ ┣obs_init_module(win-mf.dll): 213.418 ms
08:34:52.035: ┃ ┣obs_init_module(win-wasapi.dll): 0.005 ms
08:34:52.035: ┃ ┗reset_win32_symbol_paths: 0.071 ms
08:34:52.035: ┣OBSBasic::ResetOutputs: 0.197 ms
08:34:52.035: ┣OBSBasic::CreateHotkeys: 0.022 ms
08:34:52.035: ┣OBSBasic::InitService: 2.303 ms
08:34:52.035: ┣OBSBasic::InitPrimitives: 0.225 ms
08:34:52.035: ┗OBSBasic::Load: 2906.04 ms
08:34:52.035: obs_hotkey_thread(25 ms): min=0.002 ms, median=0.004 ms, max=2.023 ms, 99th percentile=0.2 ms, 100% below 25 ms
08:34:52.035: audio_thread(Audio): min=0 ms, median=0.124 ms, max=0.482 ms, 99th percentile=0.19 ms
08:34:52.035: ┗receive_audio: min=0.001 ms, median=0.087 ms, max=0.323 ms, 99th percentile=0.141 ms, 0.941687 calls per parent call
08:34:52.035: ┣buffer_audio: min=0 ms, median=0 ms, max=0.046 ms, 99th percentile=0.001 ms
08:34:52.035: ┗do_encode: min=0.071 ms, median=0.085 ms, max=0.32 ms, 99th percentile=0.137 ms
08:34:52.035: ┗encode(simple_aac): min=0.068 ms, median=0.077 ms, max=0.275 ms, 99th percentile=0.109 ms
08:34:52.035: obs_video_thread(16.6667 ms): min=0.188 ms, median=1.178 ms, max=2868.55 ms, 99th percentile=3.481 ms, 99.9983% below 16.667 ms
08:34:52.035: ┣tick_sources: min=0.001 ms, median=0.165 ms, max=2868.11 ms, 99th percentile=0.535 ms
08:34:52.035: ┣render_displays: min=0 ms, median=0.697 ms, max=4.524 ms, 99th percentile=2.517 ms
08:34:52.035: ┗output_frame: min=0.184 ms, median=0.295 ms, max=1.968 ms, 99th percentile=0.656 ms
08:34:52.035: ┣gs_context(video->graphics): min=0.082 ms, median=0.139 ms, max=1.752 ms, 99th percentile=0.456 ms
08:34:52.035: ┃ ┣render_video: min=0.015 ms, median=0.038 ms, max=0.511 ms, 99th percentile=0.068 ms
08:34:52.035: ┃ ┃ ┣render_main_texture: min=0.003 ms, median=0.02 ms, max=0.485 ms, 99th percentile=0.045 ms
08:34:52.035: ┃ ┃ ┣render_output_texture: min=0.002 ms, median=0.007 ms, max=0.107 ms, 99th percentile=0.012 ms
08:34:52.035: ┃ ┃ ┣render_convert_texture: min=0.001 ms, median=0.007 ms, max=0.25 ms, 99th percentile=0.01 ms
08:34:52.035: ┃ ┃ ┗stage_output_texture: min=0 ms, median=0.002 ms, max=0.117 ms, 99th percentile=0.003 ms
08:34:52.035: ┃ ┣download_frame: min=0 ms, median=0.001 ms, max=0.411 ms, 99th percentile=0.002 ms
08:34:52.035: ┃ ┗gs_flush: min=0.036 ms, median=0.099 ms, max=1.693 ms, 99th percentile=0.402 ms
08:34:52.035: ┗output_video_data: min=0.13 ms, median=0.151 ms, max=1.567 ms, 99th percentile=0.239 ms
08:34:52.035: video_thread(video): min=0 ms, median=0.69 ms, max=1.632 ms, 99th percentile=1.072 ms
08:34:52.035: ┗receive_video: min=0 ms, median=0.69 ms, max=1.629 ms, 99th percentile=1.072 ms
08:34:52.035: ┗do_encode: min=0.448 ms, median=0.69 ms, max=1.628 ms, 99th percentile=1.072 ms
08:34:52.035: ┗encode(simple_h264_stream): min=0.447 ms, median=0.678 ms, max=1.598 ms, 99th percentile=1.058 ms
08:34:52.035: =================================================
08:34:52.035: == Profiler Time Between Calls ==================
08:34:52.035: obs_hotkey_thread(25 ms): min=24.197 ms, median=25.275 ms, max=33.675 ms, 73.6927% within ±2% of 25 ms (0.00755306% lower, 26.2998% higher)
08:34:52.035: obs_video_thread(16.6667 ms): min=14.784 ms, median=16.667 ms, max=2868.56 ms, 99.9767% within ±2% of 16.667 ms (0.0116407% lower, 0.0116407% higher)
08:34:52.035: =================================================
08:34:52.091: Number of memory leaks: 25

I think it has to be something to do with my scenes or studio mode. While in studio mode I notice a huge increase in cpu usage, when I disabled everything in my AFK scene and game scene the problem still exists however.

Here are my settings as of posting this:
OUTPUT: https://gyazo.com/f3b55a1b9db33c6bd802e76079fb258f
VIDEO: https://gyazo.com/554d9f524e2d1425351eaa9d105bc02e
ADVANCED: https://gyazo.com/e64f652054ec1c3fee18bf9a1d890d94
 
Last edited:
Top