Using GC(Garbage Collector) for Conquer Online

06/18/2013 02:17 CriticallyDev#1
As the title probably says it all, I'm curious to know:

Question: Is using the GC.Collect Method acceptable when coming across a Conquer Online source?

Reason: I'm trying to make time and put effort into Impulses 5165 Base to improve it's overall performance on a step-by-step level(for educational purposes ofc).

I personally can't decide because my knowledge in C# is still improving.

Example of GC.Collect being used:

Code:
ServerBase.Thread StatusFlagChange = new Conquer_Online_Server.ServerBase.Thread(1);
                StatusFlagChange.Execute += new Action(StatusFlagChange_Execute);
                ServerBase.Thread FloorItems = new ServerBase.Thread(1);
                FloorItems.Execute += new Action(FloorItems_Execute);
                ServerBase.Thread CharacterThread = new ServerBase.Thread(100);
                CharacterThread.Execute += new Action(CharacterThread_Execute);
                ServerBase.Thread OfflineSet = new ServerBase.Thread(100);
                OfflineSet.Execute += new Action(OfflineSet_Execute);
                GC.KeepAlive(CharacterThread); GC.KeepAlive(FloorItems); GC.KeepAlive(StatusFlagChange);
References: [Only registered and activated users can see links. Click Here To Register...]
: [Only registered and activated users can see links. Click Here To Register...]
Many thanks in advance.
06/18/2013 02:29 Super Aids#2
Please read this.
[Only registered and activated users can see links. Click Here To Register...]

In your case it's not necessary to use KeepAlive though.
06/18/2013 02:39 CriticallyDev#3
Quote:
Originally Posted by Super Aids View Post
Please read this.
[Only registered and activated users can see links. Click Here To Register...]

In your case it's not necessary to use KeepAlive though.
Thanks for the link.

Why is not necessary for me to have KeepAlive though? Isn't it necessary for the GC Method to reclaim unused memory?
06/18/2013 02:54 Super Aids#4
Those threads are not unused memory unless you abort the threads or never starts them.
06/18/2013 09:10 Korvacs#5
Quote:
Originally Posted by CriticallyDev View Post
Thanks for the link.

Why is not necessary for me to have KeepAlive though? Isn't it necessary for the GC Method to reclaim unused memory?
Its very rare that you ever need use the Garbage Collector directly, its always running in the background doing the job, only in very specific circumstances do you need to force it to collect/not collect. That isn't one of them.
06/19/2013 03:08 CriticallyDev#6
Understood.

Thank you for the support, this thread can now be closed.