vendredi 31 juillet 2015

Memory consumption when using events in c#

I'm adding lightweight logging functionality to some enterprise software, and I'm trying to do so without adding much of a memory footprint, as memory consumption is a major problem with the software. Therefore, my goal is to not add any references to the current projects. The problem is, there are only 3 projects that have the reference I need to make the call to log information. The problem is, these places aren't shared across the code, and so no one can really call them. In order to get around this, I created a logging event in a static, shared place. I then, from my logging class, hook it up to that event. Then, whenever that event is called from the shared place, the logging gets called. Now, I have to instantiate the logging class at the beginning of my app in order to hook into the event in the shared class. This obviously then lives throughout the lifecycle of the app. Does this add a lot of memory overhead?

I'm sorry if this is vague, but it's the best I could do to try to explain my situation.

Aucun commentaire:

Enregistrer un commentaire