Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Special syntax on Using
Message
De
12/02/2014 09:53:15
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01594076
Message ID:
01594149
Vues:
28
>>>You should get to the reason the memory usage increases then figure out how to resolve the issue.
>>
>>Yes, but this is very difficult to find. That is why the first step was to implement the Using approach where it applies. This seems to be related to the implementation of SOAP SVC. I have it at one location in the framework and the application using it seems to obtain a side effect from it. So, in the application, I have added the Using approach on the initialization of the SOAP SVC service and so far the memory stands straight.
>
>Maybe you can wrap the "unmanaged" class you want to be USING into a class that does implement iDisposable. That's what I did with Excel, and it works reasonably well.
>
>Please have a look at how I "iDisposable"d my wrapped excel class.
>
>I'm using the Using construct with it, and it does dispose of the object once it goes out of scope. (I.e. excel does not remain in the task list). It's what you are supposed to do when you don't want to wait for the garbage collector to get rid of the "unmanged" classes.
>
>Don't ask me how it works.... I have no clue.

Yes, the class has the dispose implementation. However, the System.ServiceModel.OperationContextScope used in it has a flaw and really requires Using in the custom class.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform