Click here to Skip to main content
15,566,366 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# threading question: Invoke() fails with ObjectDisposedException Pin
Patrick Fox9-Sep-10 12:58
Patrick Fox9-Sep-10 12:58 
AnswerRe: C# threading question: Invoke() fails with ObjectDisposedException Pin
Jason J. Chase12-Sep-10 21:14
Jason J. Chase12-Sep-10 21:14 
QuestionBest solution for a form that looks like a paper page formular Pin
lvq6848-Sep-10 3:10
lvq6848-Sep-10 3:10 
AnswerRe: Best solution for a form that looks like a paper page formular Pin
Pete O'Hanlon8-Sep-10 3:44
mvaPete O'Hanlon8-Sep-10 3:44 
GeneralRe: Best solution for a form that looks like a paper page formular Pin
lvq6848-Sep-10 11:21
lvq6848-Sep-10 11:21 
GeneralRe: Best solution for a form that looks like a paper page formular Pin
Pete O'Hanlon8-Sep-10 11:42
mvaPete O'Hanlon8-Sep-10 11:42 
AnswerRe: Best solution for a form that looks like a paper page formular Pin
The Man from U.N.C.L.E.8-Sep-10 3:47
The Man from U.N.C.L.E.8-Sep-10 3:47 
QuestionMemory leaks while calling functions from another assembly. Pin
Aseem Sharma8-Sep-10 2:56
Aseem Sharma8-Sep-10 2:56 
Hi all,

In our application, we need to call functions from external assembly. Below is what we have already done?

1 Please note that user can create his own assemblies and can call any static public functions in those assemblies from our application.

2 Once the user has created his assembly, he let our application know which function in that assembly is to be called.

3 We load user specified assembly in a separate application domain.

4 We determine if the function that user wants to execute, actually exists in that assembly. (For this we use reflection to get complete information of the assembly).

5 Then we create parameters that are to be passed to the function in external assembly. For preparing parameters we are using a class Arg derived from interface MarshalByRefObject as below:
internal abstract class Arg : MarshalByRefObject
{
...
}


So Arg's object will represent parameters to be passed.

6 Now the problem comes. More the parameter we pass to a function in external assembly, more the memory leaks are there. If we call a function several times, memory leaks grows proportionally (even when that separate app-domain is unloaded).

7 So the reason of these memory leaks is that parameters (represented by Arg class derived from MarshalByRefObject) are not being collected by Garbage Collector (even when called explicitly).

8 Any comment on how can we free objects of Arg (created for passing parameters)? Or is there something that we should take extreme care about while doing stuff like this?

Regards
Aseem
AnswerRe: Memory leaks while calling functions from another assembly. Pin
Luc Pattyn8-Sep-10 3:27
sitebuilderLuc Pattyn8-Sep-10 3:27 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Aseem Sharma8-Sep-10 3:48
Aseem Sharma8-Sep-10 3:48 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Luc Pattyn8-Sep-10 3:55
sitebuilderLuc Pattyn8-Sep-10 3:55 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Aseem Sharma8-Sep-10 4:41
Aseem Sharma8-Sep-10 4:41 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Pete O'Hanlon8-Sep-10 5:41
mvaPete O'Hanlon8-Sep-10 5:41 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Luc Pattyn9-Sep-10 17:07
sitebuilderLuc Pattyn9-Sep-10 17:07 
AnswerRe: Memory leaks while calling functions from another assembly. Pin
David Knechtges8-Sep-10 4:42
David Knechtges8-Sep-10 4:42 
GeneralRe: Memory leaks while calling functions from another assembly. Pin
Aseem Sharma8-Sep-10 4:59
Aseem Sharma8-Sep-10 4:59 
AnswerRe: Memory leaks while calling functions from another assembly. Pin
Jason J. Chase12-Sep-10 21:31
Jason J. Chase12-Sep-10 21:31 
QuestionThread.Join() and GUI Pin
Keith Vitali8-Sep-10 1:39
Keith Vitali8-Sep-10 1:39 
AnswerRe: Thread.Join() and GUI Pin
Luc Pattyn8-Sep-10 1:59
sitebuilderLuc Pattyn8-Sep-10 1:59 
AnswerRe: Thread.Join() and GUI Pin
Kubajzz8-Sep-10 2:03
Kubajzz8-Sep-10 2:03 
AnswerRe: Thread.Join() and GUI Pin
Fayu8-Sep-10 5:09
Fayu8-Sep-10 5:09 
AnswerRe: Thread.Join() and GUI Pin
samuelms8-Sep-10 8:10
samuelms8-Sep-10 8:10 
Questionunable to create shortcut for the application on desktop using setup and deployment project Pin
NarVish7-Sep-10 23:28
NarVish7-Sep-10 23:28 
AnswerRe: unable to create shortcut for the application on desktop using setup and deployment project Pin
Richard MacCutchan8-Sep-10 4:07
mveRichard MacCutchan8-Sep-10 4:07 
QuestionAssigning ICON to new file type (*.dtl) Pin
himuskanhere7-Sep-10 21:06
himuskanhere7-Sep-10 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.