You can see the C# API that you can use to do this at:
Process.WorkingSet64 Property (System.Diagnostics) | Microsoft Docs[
^]
That will provide you with the necessary calls you can do to get the amount of memory that is being consumed by a process.
However, to write a console app that interacts with the service is something that takes a lot more explaining.
This is Interprocess Communication and is a lot more involved:
Interprocess Communications - Win32 apps | Microsoft Docs[
^]
Here's what you'd have to do:
1) Create a method in your service that will return the memory details as JSON.
2) Use WCF (Windows Comunication Foundation --
Windows Communication Foundation - Wikipedia[
^] ) to build the IPC into the Service -- this will call into the method in your service that gets the memory info.
3) Call the WCF from your console app to get the JSON
4) Display the returned JSON in your console app.
Here's a basic getting started sample for WCF:
Tutorial: Host and run a basic Windows Communication Foundation service - WCF | Microsoft Docs[
^]