Garbage Collection

An evolving, supported alternative to Rovi
Forum rules
★ Download the latest EPG123 here: http://epg123.garyan2.net <> Setup guide here: http://epg123.garyan2.net/downloads/epg123_Guide.pdf
Post Reply
alhaunts

Posts: 6
Joined: Wed Jan 01, 2020 5:45 pm
Location:

HTPC Specs: Show details

Garbage Collection

#1

Post by alhaunts » Sun Sep 13, 2020 11:55 am

Got an old install of WMC on Windows 7 that's been working fine for years. Noticed after updating EPG123 to newest version that MCUpdate runs twice every 5 days (on different days). Once triggered by EPG123 and then a couple of days later from WMC itself. Is this expected behavior? I guess there's no downside to garbage collection twice as often?

Cheers, Al.

User avatar
garyan2

Posts: 5185
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#2

Post by garyan2 » Sun Sep 13, 2020 4:18 pm

No, that isn't expected though I figured there were some corner cases that may make it possible. I thought they could happen on the same day though, and not days apart. There are 3 registry keys to control when GC is run.

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Service\Epg]
"dbgc:next run time"="2020-09-15T19:47:36"
"dl"=dword:00000000
"mcupdate:next run time"=""
"dl" disables WMC 'Automatically download Windows Media Center data"; same as going settings->General->Automatic Download Options and unchecking the box.
"dbgc:next run time" is for EPG123 to determine when to run garbage collection next.
'mcupdate:next run time" is for WMC to determine when to run garbage collection next.

When I was adding this feature, I noticed running garbage collection manually or with EPG123 would always update the "mcupdate:next run time" value to be 5 days plus some random number of hours:minutes:seconds. So as long as EPG123 was doing it every 5 days, the WMC GC would never get triggered because the time would keep getting reset into the future.

Questions:
What do your registry values look like?
If you open 'Task Scheduler' and navigate to \Microsoft\Windows\Media Center, take a look at the 'Next Run Time' and 'Last Run Time' values of the "mcupdate_scheduled" task. What are those values?
Also in 'Task Scheduler', take a look at the 'Actions' tab of the "mcupdate" task. Does it point to EPG123?

To guarantee that WMC will no longer run the GC, you can disable the "mcupdate_scheduled" task.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

alhaunts

Posts: 6
Joined: Wed Jan 01, 2020 5:45 pm
Location:

HTPC Specs: Show details

#3

Post by alhaunts » Sun Sep 13, 2020 7:57 pm

From the registry:

dbgc:next run time = 2020-09-16T17:15:09
dl = 0x00000000 (0)
mcupdate:next run time = 2020-09-14T04:21:32-0640428-04:00


From task scheduler:

mcupdate_scheduled: next run time: 9/14/2020 4:21:32 AM last run time: 9/9/2020 4:22:37 AM
mcupdate: actions is pointing to: "C:\Program Files (x86)\epg123\epg123Client.exe" $(Arg0)

User avatar
garyan2

Posts: 5185
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#4

Post by garyan2 » Sun Sep 13, 2020 8:36 pm

Strange. When mcupdate performs the garbage collection it is supposed to update the registry. I was relying on the EPG123 run of the garbage collection to do the same which I saw that it did on my machine. When EPG123 did its' last GC, both registry entries should have been updated to 2020-09-16. I don't know why yours didn't. I'll have to run some more tests.

My suggestion would be to disable the mcupdate_scheduled task. This will bring it back down to only 1 run every 5 days instead of 2. It also gives you the benefit of knowing exactly when it will run. The other option is to modify your epg123_update task to include the "-nogc" parameter switch.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

alhaunts

Posts: 6
Joined: Wed Jan 01, 2020 5:45 pm
Location:

HTPC Specs: Show details

#5

Post by alhaunts » Sun Sep 13, 2020 9:42 pm

Thanks Gary,

If it helps your testing at all, this is on windows 7 pro x64 sp1 version 6.1.7601.17514 running 24/7 as an HTPC with no login. Intel i3-2120T w/8GB ram.

BTW: Does the "Perform optimization" option in Settings/General do anything useful now that MS has shutdown their servers?

Regards, Al.

alhaunts

Posts: 6
Joined: Wed Jan 01, 2020 5:45 pm
Location:

HTPC Specs: Show details

#6

Post by alhaunts » Sun Sep 13, 2020 9:48 pm

Also, I disabled mcupdate_scheduled in task manager. Will advise if any more dbgc weirdness occurs.

User avatar
garyan2

Posts: 5185
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#7

Post by garyan2 » Mon Sep 14, 2020 12:01 am

I honestly didn't look into what "Perform optimization" does. Did you have that enabled? If so, maybe that is why the WMC garbage cleanup was running still.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

alhaunts

Posts: 6
Joined: Wed Jan 01, 2020 5:45 pm
Location:

HTPC Specs: Show details

#8

Post by alhaunts » Mon Sep 14, 2020 1:26 am

yes, I do have it enabled. I tried turning it off but no change in dbgc behavior so I re-enabled it.

User avatar
IT Troll

Posts: 801
Joined: Sun Nov 27, 2011 9:42 am
Location: Edinburgh, UK

HTPC Specs: Show details

#9

Post by IT Troll » Mon Sep 14, 2020 7:14 am

The Internet says it is a process restart. Possibly something that was carried over from the early days when they had a bit of a memory leak?
All that Optimization does is perform an orderly shutdown and restart of all of the eH* (Media Center) processes.
I guess the way to prove it is to schedule it for a specific time then watch the process list.
Are you a Recorded TV HD user or want to give it a try? Check out the new community-made update; Recorded TV HD v2.1.1

User avatar
garyan2

Posts: 5185
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#10

Post by garyan2 » Mon Sep 14, 2020 3:57 pm

I think it is a little more than that. I did a little experimenting with it last night and found that the optimization also builds some files in the ehome\SharedSBE folder that are locked by another process (haven't found what yet). I suspect these are for MSSQL. I also found out that disabling optimization does not terminate that process, so after disabling it, the station needs to be reboot in order to delete the files.

Personally, I've never trusted that option. The couple times I enabled it in the past (before EPG123), I ended up having database recoveries within a few days. I've never used it since and that is probably a big reason I never tested with it enabled.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

Post Reply