Click here to Skip to main content
15,867,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: Partial class: is this a bug? Pin
Septimus Hedgehog3-Mar-13 7:49
Septimus Hedgehog3-Mar-13 7:49 
GeneralRe: Partial class: is this a bug? Pin
Septimus Hedgehog6-Mar-13 5:53
Septimus Hedgehog6-Mar-13 5:53 
Questioneven numbers table Pin
Yrtsg1-Mar-13 22:11
Yrtsg1-Mar-13 22:11 
AnswerRe: even numbers table Pin
harold aptroot1-Mar-13 23:29
harold aptroot1-Mar-13 23:29 
QuestionC# Console.ReadLine runns out of memory Pin
dcof1-Mar-13 8:45
dcof1-Mar-13 8:45 
AnswerRe: C# Console.ReadLine runns out of memory Pin
Jibesh1-Mar-13 9:13
professionalJibesh1-Mar-13 9:13 
AnswerRe: C# Console.ReadLine runns out of memory Pin
OriginalGriff1-Mar-13 21:59
mveOriginalGriff1-Mar-13 21:59 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 8:07
dcof2-Mar-13 8:07 
The program that is executed is called by a C# 2010 windows application (called app1) that was converted from a console application.
The following is an example of some of the calls made from app1 to the C# 2008 application that is having the memory problem called app2.
string[] SubPkgIDs = rData.details.Where(c => c.Package_ID.StartsWith("SUB").Select(c => c.PackID).Distinct().ToArray();
            foreach (string SubPkgID in SubPkgIDs)
            {
                {
                    Process eProcess = new Process();
                    String Process_Arguments = null;
                    eProcess.StartInfo.UseShellExecute = false;
                    e_Process.StartInfo.FileName = "app2.exe";
                    Process_Arguments = " 3 " + SubPkgID;
                    eProcess.StartInfo.Arguments = Process_Arguments;
                    eProcess.Start();
                    eProcess.WaitForExit(1800);
                    //eProcess.WaitForExit();
                    eProcess.Dispose();
                    Process_Arguments = null;
                   }
            }

I think the line of code that is causing the memory problem possibly is the following:
eProcess.WaitForExit(1800);

App1 is not waiting for a response basically from app2.exe program that is being called. It waits the 1800 *.secs and makes
the next calls. There is no reason for app1 to wait or app2 to finish executing since it does not need a response from app2.
However if this is causing the memory problem I can wait for the app2 program to finish executing.

App1 and app2 were setup to be single threaded.

In the app1 program that calls the second program called app2, I am thinking of putting the following code at the end of the program:
foreach (Process proc in Process.GetProcessesByName("app2"))
       {
           proc.Kill();
       }

This way the app2 processes that are still in memory can be released.

Thus based upon what I mentioned previously and what I just mentioned above, can you show me code and/or tell me what you would do to solve the memory problem I am having?
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell2-Mar-13 10:26
jschell2-Mar-13 10:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 11:26
dcof2-Mar-13 11:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell3-Mar-13 5:54
jschell3-Mar-13 5:54 
QuestionTrying to use child class method by overriding parent Pin
MichCl1-Mar-13 8:26
MichCl1-Mar-13 8:26 
AnswerRe: Trying to use child class method by overriding parent Pin
OriginalGriff1-Mar-13 8:41
mveOriginalGriff1-Mar-13 8:41 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl1-Mar-13 9:30
MichCl1-Mar-13 9:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
jschell2-Mar-13 10:30
jschell2-Mar-13 10:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 2:23
MichCl5-Mar-13 2:23 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 9:40
MichCl5-Mar-13 9:40 
QuestionPassing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 5:42
professionalJimmyRopes1-Mar-13 5:42 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 7:13
harold aptroot1-Mar-13 7:13 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 7:39
professionalJimmyRopes1-Mar-13 7:39 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 7:50
harold aptroot1-Mar-13 7:50 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 12:50
professionalJimmyRopes1-Mar-13 12:50 
AnswerRe: Passing parameters from unmanaged code to managed code by reference Pin
Eddy Vluggen1-Mar-13 8:31
professionalEddy Vluggen1-Mar-13 8:31 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 14:15
professionalJimmyRopes1-Mar-13 14:15 
Questionrecord mouse coordinates when mouse is clicked on inkcanvas Pin
Naman20071-Mar-13 4:59
Naman20071-Mar-13 4:59 

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.