Hi,
Being annoyed with the problems with the Compress plug-in i decided to try to fix it. The problem is that whenever a transcoding job is in progress, the call GC.GetTotalMemory(true) doesnt return(at least within any reasonable time) when called in GUIWindow OnMessage when it gets a GUI_MSG_WINDOW_DEINIT message. This causes the effect that if you try to navigate away from the current window while the job is in progress, the gui blocks/locks.
What i would like to know is a bit more about what the GC calls does. According to the documentation for GC.GetTotalMemory:
From this it seems that it will a "short interval" before returning, but this doesnt seem to be the case. However this only happens when a transcoding job is in progress.
I fixed the problem in my local installation by changing the call to GC.GetTotalMemory(false). Could the explanation be that the call waits for GC to finish, but GC might run with a very low priority so that it wont run because the transcoding job is eating up all the CPU time, locking the GUI which is waiting for it?
I would also like to know why there are 3 call to GC.collect in a row preceding the call to GC.GetTotalMemory, why doesnt one suffice?
Being annoyed with the problems with the Compress plug-in i decided to try to fix it. The problem is that whenever a transcoding job is in progress, the call GC.GetTotalMemory(true) doesnt return(at least within any reasonable time) when called in GUIWindow OnMessage when it gets a GUI_MSG_WINDOW_DEINIT message. This causes the effect that if you try to navigate away from the current window while the job is in progress, the gui blocks/locks.
What i would like to know is a bit more about what the GC calls does. According to the documentation for GC.GetTotalMemory:
Code:
//
// Summary:
// Retrieves the number of bytes currently thought to be allocated. A parameter
// indicates whether this method can wait a short interval before returning,
// to allow the system to collect garbage and finalize objects.
//
// Parameters:
// forceFullCollection:
// A Boolean value which, if true, indicates that this method can wait for garbage
// collection to occur before returning.
//
// Returns:
// A number that is the best available approximation of the number of bytes
// currently allocated in managed memory.
From this it seems that it will a "short interval" before returning, but this doesnt seem to be the case. However this only happens when a transcoding job is in progress.
I fixed the problem in my local installation by changing the call to GC.GetTotalMemory(false). Could the explanation be that the call waits for GC to finish, but GC might run with a very low priority so that it wont run because the transcoding job is eating up all the CPU time, locking the GUI which is waiting for it?
I would also like to know why there are 3 call to GC.collect in a row preceding the call to GC.GetTotalMemory, why doesnt one suffice?