Memory Leak when enabling CodeProject.AI

Post Reply
Mace
Posts: 2
Joined: Thu Dec 21, 2023 4:07 pm

Memory Leak when enabling CodeProject.AI

Post by Mace »

After several years of running Sighthound because of its rather solid AI-based object recognition, I decided to move to Blue Iris in combination with CodeProject.AI. So far I'm okay with the results (still working on tweaking the AI part). However I discovered that my system was suffering from a memory leak. After doing several tests, it turned out that either CodeProject.AI, or the combination of CodeProject.AI and Blue Iris is causing the memory leak. With CodeProject.AI enabled, memory usage will start around 40 % and in the course of a day or two this will creep up to 95-99 %, grinding the system to a halt. By disabling AI (disabling CodeProject.AI service, disabling all AI-related items from the Blue Iris setup), memory consumption remains steady at around 36 %. The weird thing is that none of the Windows memory metrics (Memory - active private working set, Commit size, ...) indicate anything near the suggested percentage of excessive memory usage when AI is enabled. Both Blue Iris and CodeProject.AI (including Python) will take up around 1 GB each.

I could schedule a daily reboot of the laptop as a workaround, but of course the root cause needs to be addressed. For now, I've simply disabled CodeProject.AI and am relying on Blue Iris's default motion detection (which seems to work okay).

I'm running Windows 11 Pro on a Lenovo LOQ 15APH8 laptop with 16 GB of RAM, an AMD 7840HS and an RTX 4060. In the BIOS I've selected 'Discrete graphics only' to make sure the RTX 4060 is used at all times.
Blue Iris version is 5.8.2.2 and CodeProject.AI version is 2.3.4.

Anyone else having similar issues regarding the memory leak and can anyone confirm whether it's CodeProject.AI and/or the combination with Blue Iris that is causing it?

Cheers
Last edited by Mace on Thu Dec 21, 2023 10:26 pm, edited 1 time in total.
MikeBwca
Posts: 1076
Joined: Thu Jun 20, 2019 5:39 am

Re: Memory Leak when enabling CodeProject.AI

Post by MikeBwca »

...
Last edited by MikeBwca on Fri Apr 05, 2024 7:13 pm, edited 1 time in total.
Mace
Posts: 2
Joined: Thu Dec 21, 2023 4:07 pm

Re: Memory Leak when enabling CodeProject.AI

Post by Mace »

MikeBwca wrote: Sat Dec 23, 2023 5:34 am BI 5.8.2.4, and CP 2.2.4. Working well.
I'll try CP 2.2.4 and see what happens. So what's the reason you're running CP 2.2.4 rather than 2.3.4? Did you run into my issue?
MikeBwca
Posts: 1076
Joined: Thu Jun 20, 2019 5:39 am

Re: Memory Leak when enabling CodeProject.AI

Post by MikeBwca »

...
Last edited by MikeBwca on Fri Apr 05, 2024 7:13 pm, edited 1 time in total.
User avatar
TimG
Posts: 2151
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Memory Leak when enabling CodeProject.AI

Post by TimG »

Running CPAI v2.4.6 RC2 here since yesterday and I haven't had memory leaks with this or any of the previous intermediate versions.

Attempted latest NVIDIA GTX1650 video driver (Up to CUDA 12.3) with CUDA 11.8 tools at the same time. ALPR now doesn't work, but I can live without that until things catch up. AI with custom models is working well.

Secret of my success: Good back ups :lol:

FWIW: The two things I have seen cause memory issues were Anti Virus exclusions, and the anti-ransomware component of 'Acronis True Image' which brought down all of my pc's until I disabled it.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Post Reply