Author Topic: v22 memory leak?  (Read 4424 times)

JeffB

  • Senior Community Member
  • Posts: 278
  • Hero Points: 11
Re: v22 memory leak?
« Reply #15 on: November 17, 2017, 10:01:45 pm »
I assume it does not.  FYI....The Virtual Size is just over 6GB.

I'll leave it up for a while and see if it keeps growing.

JeffB

  • Senior Community Member
  • Posts: 278
  • Hero Points: 11
Re: v22 memory leak?
« Reply #16 on: November 22, 2017, 05:54:57 pm »
FYI...After sitting for a few days with only minor usage, the resident memory is 6.35GB and Virtual is 7.5GB.

IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #17 on: November 27, 2017, 07:18:00 pm »
Additional follow up...

Total RES memory for my VS process is now a bit over 1GB and continues to grow, albeit slowly. A quick peek at the "/proc/pid/smaps" file suggests most of that is heap (see output below).

Regards,
Iker

Code: [Select]
02f18000-3b924000 rwxp 00000000 00:00 0                                  [heap]
Size:             927792 kB
Rss:              927084 kB
Pss:              927084 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:    927084 kB
Referenced:       920808 kB
Anonymous:        927084 kB
AnonHugePages:    864256 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr ex mr mw me ac sd

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 865
  • Hero Points: 55
Re: v22 memory leak?
« Reply #18 on: December 06, 2017, 07:03:20 pm »
Thanks for the updates.  We found the leak that probably accounts for your continued resident memory growth, and it's been fixed for the point release.

For our current tests, the leak was slow enough where it got lost in the noise of memory we keep in caches.  But editing large source files, or files that are really tag dense (like XML files) can make the leak fast enough to observe just watching the OS reports on memory usage.  Just running for a long time with normal usage will leak as well, just not as quickly.

IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #19 on: December 07, 2017, 09:48:12 pm »
Great to hear! Thanks for the follow up.

Regards,
Iker


IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #20 on: January 22, 2018, 04:43:50 pm »
Hi Patrick,

I switched to version 22.0.1 and while the memory leak seems to have slowed down it's still present (eg, 1GB+ heap after a few days). It also appears that as memory use grows editing becomes more janky/less responsive: cursor movement and scrolling stagger, noticeable delays in autocomplete, etc.

Are there any diagnostics I can enable to help track the issue?

Regards,
Iker

JeffB

  • Senior Community Member
  • Posts: 278
  • Hero Points: 11
Re: v22 memory leak?
« Reply #21 on: January 22, 2018, 05:38:08 pm »
FYI...
The leak seems to be gone for me.  I have noticed unusual delays and extreme lapses in response, but I'm not sure if that's related only to Python files or not.

Jeff

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 865
  • Hero Points: 55
Re: v22 memory leak?
« Reply #22 on: January 23, 2018, 03:19:28 pm »
@IkerAriz, probably the best option is to turn on Slick-C profiling when it starts getting janky, do whatever operations are showing delays for you for a few minutes, and then turn it off and send us the profile.  If there is a relation between the memory use and the jankiness, then that could point us in the right direction. You can access the profiler controls in the Macro -> Slick-C Profile submenu.  In the meantime, I'll re-run some of the memory tests with a project setup like you described, to see if I can spot anything I've missed.

I see from one of your previous posts that background tagging is disabled, so there are a few things that can block the main thread with that.  After the profiling, it narrow things further to see if that makes a difference. 

IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #23 on: January 30, 2018, 06:34:56 pm »
Hi Patrick,

I enabled background tagging and UI performance didn't get better (AFAICT) but memory consumption did appear to grow faster. Attached is a slick-c profile (BG tagging enabled) that captures a few examples of significant latency.

Thanks,
Iker

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 865
  • Hero Points: 55
Re: v22 memory leak?
« Reply #24 on: January 30, 2018, 06:51:25 pm »
Thanks, looking at the profile. 

Quick question: do you have C# files in your project, or were you editing any? 

IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #25 on: January 30, 2018, 07:36:08 pm »
My project has 4 C# files but I was not editing them (the files are part of the project but they're practically never touched). At the time I produced the profile I was editing a C++ file.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2364
  • Hero Points: 319
Re: v22 memory leak?
« Reply #26 on: January 30, 2018, 08:34:57 pm »
Looking over your profiling results also.  My suggestion to eliminate the hiccups.  Document > C/C++ Options > Auto-Complete > Auto-list compatible values > OFF (uncheck).  Also turn off Document > C/C++ Options > Context Tagging > Auto-list compatible parameters.

While nice to have, these two features require a lot of calculation, especially with templates, which I can see from your profiling data that you have a lot of.

You can manually force SlickEdit to list compatible values by hitting Ctrl+,


IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #27 on: February 02, 2018, 04:56:04 pm »
Thanks Dennis. Disabling those two features improved responsiveness. However, the memory issue remains with heap consumption regularly exceeding 1GB.

BTW, I noticed something that may be of interest. I recently added another C++ project to my workspace with ~1200 files and made it inactive (ie, my first project with ~3800 files is the active one). I quit VSE and then went through the following steps:
  • Start VSE with no open files.
  • Check memory. Heap use is 175 MB.
  • Click open a single 63-line C++ file in my first project. No edits/movement in file.
  • Check memory. Heap use is 178 MB.
  • Click open a single 125-line C++ file in newly added project. No movements/edits in file.
  • Check memory. Heap use is 266 MB.
When I make the new project "active" and repeat the steps above the big memory jump happens in step 4.

Iker

IkerAriz

  • Senior Community Member
  • Posts: 117
  • Hero Points: 3
Re: v22 memory leak?
« Reply #28 on: February 15, 2018, 12:46:54 pm »
After disabling "Auto-list compatible values", "Auto-list compatible parameters" and "C/C++->auto-complete" typing latency is still significant; in particular, when hitting an opening parentheses, a member access period or arrow.

Attached is another profile that captures latency with this configuration. Note that heap memory for this instance of VSE is nearly 1.4GB (after a couple of days).


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2364
  • Hero Points: 319
Re: v22 memory leak?
« Reply #29 on: February 19, 2018, 08:07:06 pm »
Are you using Boost, or heavily using the STL in your code?