Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 02:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Using GC(Garbage Collector) for Conquer Online

Discussion on Using GC(Garbage Collector) for Conquer Online within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
CriticallyDev's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 87
Received Thanks: 4
Lightbulb Using GC(Garbage Collector) for Conquer Online

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:
:
Many thanks in advance.
CriticallyDev is offline  
Old 06/18/2013, 02:29   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
Please read this.


In your case it's not necessary to use KeepAlive though.
Super Aids is offline  
Old 06/18/2013, 02:39   #3
 
CriticallyDev's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 87
Received Thanks: 4
Question

Quote:
Originally Posted by Super Aids View Post
Please read this.


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?
CriticallyDev is offline  
Old 06/18/2013, 02:54   #4
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
Those threads are not unused memory unless you abort the threads or never starts them.
Super Aids is offline  
Old 06/18/2013, 09:10   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
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.
Korvacs is offline  
Old 06/19/2013, 03:08   #6
 
CriticallyDev's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 87
Received Thanks: 4
Understood.

Thank you for the support, this thread can now be closed.
CriticallyDev is offline  
Reply




All times are GMT +2. The time now is 02:39.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.