Menu

#179 Memory leak w/Windows 10/Windows Server 2016?

Unscheduled
closed
nobody
fixed-4.3.6 (4)
Bug
1
2019-08-03
2019-07-11
Anonymous
No

Possible memory leak under Windows Server 2016?

I operate several Tcl programs which run without interruption for days, weeks or even months. In some of them, I recently noticed ever growing "private bytes" usage (via Sysinternals ProcExp). I tried to narrow down which construct is responsible for this phenomen, which I didn't notice on the OS before Windows 2016 (Windows Server 2008R2 or Windows 7) and with a twapi-tclkit before 8.6.9, if I remember right...... If you simply run the following loop, you'll probably notice an ever growing memory consumption, too. Copying or deleting a large number of files pushes on the growth...:

package require twapi
twapi::import_commands

proc cb {h info} {
lassign $info op obj
after idle [list puts [format {%10s %s} $op $obj]]
}

begin_filesystem_monitor c:/ cb -patterns * -access 1 -attr 1 -create 1 -dirname 1 -filename 1 -secd 1 -size 1 -write 1 -subtree 1
vwait forever

See https://wiki.tcl-lang.org/page/TWAPI#bfbdcd02aeb643dc613729efafdf0818f1a828276bdf6824a675925fb85c584b

Discussion

  • Anonymous

    Anonymous - 2019-07-12

    I didn't notice anything obvious with a quick check at the code. I'll have to run longer term tests but will not get to it for a week or two.

    As an aside, Microsoft's file monitoring interface is not suited for a large volume transaction as you are trying to do (see the warnings in their docs).

    /Ashok

     
  • Anonymous

    Anonymous - 2019-07-12

    Hello, thanks for your attention.
    In reality I only monitor a few folders. I look at the
    whole drive here to provocate the effect.

     
  • Anonymous

    Anonymous - 2019-07-18

    I hope to take a closer look this weekend. Is it really the case the problem shows up only on Server 2016? Can you definitively say it does not show up on Win 7 or Win 10?

    /Ashok

     
  • Ashok P. Nadkarni

    I think I have found the problem. Running some tests now. Would you be able to try it out on the system where you discovered the problem?

     
  • Ashok P. Nadkarni

    Fixed in 4.3.6

     
  • Ashok P. Nadkarni

    • labels: --> fixed-4.3.6
    • status: open --> closed
     
  • Anonymous

    Anonymous - 2019-07-29

    Sorry for the delay, yes of course, i will try it out there! I'm not 100% sure that it didn't show up on Windows 7 or 10. On before, the programs ran under windows 2008R2, at least there without problems.... I will test on as many systems that I can reach... thanks in advance!!!

     
  • Anonymous

    Anonymous - 2019-07-30

    MHo: Tested on Windows Server 2016 and Windows 7 with TWAPI 4.3.7: No leak (anymore). Thanks!

     
  • Anonymous

    Anonymous - 2019-07-30

    Just tested on Windows 10, too. Again, no leak.

     
  • Anonymous

    Anonymous - 2019-08-01

    Will there be a new tclkit with twapi 4.3.7 build-in?......

     
  • Ashok P. Nadkarni

    I'm waiting for Tcl 8.6.10 so I can bundle them together. Do you need on urgently or can you wait.

     
  • Anonymous

    Anonymous - 2019-08-02

    I could generate a starkit without twapi via http://kitcreator.rkeene.org/kitcreator and put the new twapi 4.3.7 aside it. Until nmw, I couldn't manage to use it when 4.3.5 is already compiled in, as with your kits (what I greatly prefer!). Unfortunally, either solution will trigger a symantec security alert in our environment, as the reputation (use count) is - naturally - low for new modules :-) But that's another story... Yes, of course, I can wait (haven't heard yet about 8.6.10, though....) Again, thanks (Mho).

     
  • Ashok P. Nadkarni

    I have uploaded new tclkits with 4.3.7 as apparently Tcl 8.6.10 is still months away from release.

     
  • Anonymous

    Anonymous - 2019-08-03

    Thank you so much!!!

     

Anonymous
Anonymous

Add attachments
Cancel