Memory Leak in GetFileDate

Post bugreports for the Windows version here
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Memory Leak in GetFileDate

Post by Thorium »

Reproduced on: Windows 11, PureBasic 6.21 x64 and 6.30 Beta 3 x64

Run following code and open the task manager, watch as memory usage increases indefinitely.

Code: Select all

Repeat
  Delay(1)
  GetFileDate("C:\Windows\notepad.exe", #PB_Date_Modified)
ForEver
User avatar
skywalk
Addict
Addict
Posts: 4238
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Memory Leak in GetFileDate

Post by skywalk »

Ouch, does it matter which compiler options?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
le_magn
Enthusiast
Enthusiast
Posts: 289
Joined: Wed Aug 24, 2005 12:11 pm
Location: Italia

Re: Memory Leak in GetFileDate

Post by le_magn »

Confirmed on 6.21 64bit
Image
BarryG
Addict
Addict
Posts: 4213
Joined: Thu Apr 18, 2019 8:17 am

Re: Memory Leak in GetFileDate

Post by BarryG »

Which memory type are you monitoring? There's several in Task Manager so maybe I'm looking at the wrong type?

Image
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Memory Leak in GetFileDate

Post by Thorium »

skywalk wrote: Sat Oct 18, 2025 4:38 pm Ouch, does it matter which compiler options?
I have reproduced it with the default options, didnt try anything else.
My guess is that the function simply does not free a handle.
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Memory Leak in GetFileDate

Post by Thorium »

BarryG wrote: Sun Oct 19, 2025 1:24 am Which memory type are you monitoring? There's several in Task Manager so maybe I'm looking at the wrong type?

Image
I guess "working set" should show it.
BarryG
Addict
Addict
Posts: 4213
Joined: Thu Apr 18, 2019 8:17 am

Re: Memory Leak in GetFileDate

Post by BarryG »

Thorium wrote: Sun Oct 19, 2025 9:01 amI guess "working set" should show it.
Bug confirmed here with Win 11 Pro and PureBasic 6.30 Beta 3. The memory shown by Working Set rises slowly.

No such problem with PureBasic 6.10 with the same code on the same PC (the Working Set value stays the same).
Post Reply