3 people like it.

How much memory @SlackHQ uses?

This handy snippet calculates how much memory your Slack client uses. Use at your own risk. Mental safety cannot be guaranteed.

1: 
2: 
3: 
System.Diagnostics.Process.GetProcessesByName("slack")
|> Seq.sumBy (fun p -> 
  float (p.PrivateMemorySize64 / 1024L / 1024L) / 1024.)
namespace System
namespace System.Diagnostics
Multiple items
type Process =
  inherit Component
  new : unit -> Process
  member BasePriority : int
  member BeginErrorReadLine : unit -> unit
  member BeginOutputReadLine : unit -> unit
  member CancelErrorRead : unit -> unit
  member CancelOutputRead : unit -> unit
  member Close : unit -> unit
  member CloseMainWindow : unit -> bool
  member EnableRaisingEvents : bool with get, set
  member ExitCode : int
  ...

Full name: System.Diagnostics.Process

--------------------
System.Diagnostics.Process() : unit
System.Diagnostics.Process.GetProcessesByName(processName: string) : System.Diagnostics.Process []
System.Diagnostics.Process.GetProcessesByName(processName: string, machineName: string) : System.Diagnostics.Process []
module Seq

from Microsoft.FSharp.Collections
val sumBy : projection:('T -> 'U) -> source:seq<'T> -> 'U (requires member ( + ) and member get_Zero)

Full name: Microsoft.FSharp.Collections.Seq.sumBy
val p : System.Diagnostics.Process
Multiple items
val float : value:'T -> float (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.float

--------------------
type float = System.Double

Full name: Microsoft.FSharp.Core.float

--------------------
type float<'Measure> = float

Full name: Microsoft.FSharp.Core.float<_>
property System.Diagnostics.Process.PrivateMemorySize64: int64
Raw view Test code New version

More information

Link:http://fssnip.net/7Qx
Posted:8 years ago
Author:Tomas Petricek
Tags: process