Hello,
I would like to find the process with the largest memory size, how can i compare between the memory size of a process list?
Thanks
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Aug 12, 2011, 9:28 AM EDT
Jonathas Sucupira122 reputationPosted Aug 12, 2011, 9:33 AM EDT
class Program
{
static void Main(string[] args)
{
var processList = Process.GetProcesses()
.OrderByDescending(p => p.WorkingSet64)
.First();
Console.WriteLine("{0} {1}", processList.ProcessName, processList.WorkingSet64);
Console.Read();
}
}
I would like to note that this is not actually comparing, it is just printing the information of the process that is using the most memory at the time.
s44 reputationPosted Aug 12, 2011, 9:36 AM EDT
s44 reputationPosted Aug 12, 2011, 10:11 AM EDT
I would like to ask another Q:
I have a function that search for processes and pop up a msg if she found the specific process. how can i show the path of the process on textBox?
Thanks.
Jonathas Sucupira122 reputationPosted Aug 12, 2011, 10:29 AM EDT
s44 reputationPosted Aug 12, 2011, 10:38 AM EDT
say i search for the process "System". my function return a message that the process was found.
I would like that after showing that msg the path of this specific process will be shown on a text box
VulpesRank #55 · 29.2K reputationPosted Aug 12, 2011, 10:58 AM EDT
s44 reputationPosted Aug 12, 2011, 11:09 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 12, 2011, 12:02 PM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 12, 2011, 12:54 PM EDT
Jonathas Sucupira122 reputationPosted Aug 12, 2011, 2:16 PM EDT