ASP.NET webservice uses P/Invoke to call unmanaged code. Will there be memory problems between multiple webservice requests?
-
There is an ASP.NET webservice that peforms a LoadLibrary() call to load an unmanaged .dll on each call to the webservice and then P/Invokes a number of functions in the unmanaged .dll. Does the threading model used by ASP.NET to service multiple simultaneous requests mean that there can potentially be memory problems whereby the memory allocated inside the unmanaged code is stepped on by subsequent webservice requests? Are different webservice requests allocated their own memory space within the unmanaged code or are they clashing over the same space? Thanks!
-
Answer:
Where the memory allocated for p/invoke calls depends on the particular call, but overall there shouldn't be a problem as long as you clean up unmanaged resources properly, because the garbage collector wont. In that sense an ASP.NET application is just like any other multi-threaded application.
TerryB at Stack Overflow Visit the source
Related Q & A:
- How can I allow user to create posts in website using ASP.NET?Best solution by Programmers
- How to Undo previous action in asp.net?Best solution by forums.asp.net
- How to Search using jQuery ASP.Net?Best solution by Stack Overflow
- How to Play Audio files in ASP.NET?Best solution by Stack Overflow
- Why is my asp.net menu not showing properly?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.