Giter Club home page Giter Club logo

fshc's Introduction

fshc: a File and Socket Handle Counter

A tiny command line tool that prints file and socket descriptor (handle) counts for a process.

Think of it as a very small, cross-platform, more machine-friendly version of handle.exe.

Supported Operating Systems

  • Windows
  • Linux
  • macOS

Usage

# formats the output using 'jq'
fshc --pid 73847 | jq
# formats the output using 'jq'
fshc --pid 73847 --only-total | jq

License

This tool is dual-licensed under the ASL2 and MIT licenses.

fshc's People

Contributors

michaelklishin avatar the-mikedavis avatar

Stargazers

 avatar

Watchers

 avatar Alexey Lebedeff avatar Arnaud Cogoluègnes avatar Luke Bakken avatar James Cloos avatar Karl Nilsson avatar Ed avatar  avatar Kostas Georgiou avatar  avatar

Forkers

the-mikedavis

fshc's Issues

File handle count appears incorrect

Describe the bug

I built fshc on Windows 11, and started up RabbitMQ 3.12.2 using Erlang 26.0.2

Management UI:
image

I then started up an administrative shell to compare handle.exe and fshc.exe output:

> Get-Process -Name werl

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     39   147.47     133.25       0.97    2100   4 werl

C:\Users\lbakken\development\rabbitmq\fshc\target\debug [main ≡]
> handle.exe -s -p 2100

Nthandle v5.0 - Handle viewer
Copyright (C) 1997-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

Handle type summary:
  ALPC Port       : 2
  Desktop         : 1
  Directory       : 2
  EtwRegistration : 76
  Event           : 132
  File            : 33
  IoCompletion    : 6
  IRTimer         : 6
  Key             : 10
  Mutant          : 2
  Process         : 2
  Semaphore       : 6
  Thread          : 46
  TpWorkerFactory : 3
  WaitCompletionPacket: 8
  WindowStation   : 2
Total handles: 337

C:\Users\lbakken\development\rabbitmq\fshc\target\debug [main ≡]
> .\fshc.exe --pid 2100
{"pid":2100,"socket_descriptors":0,"file_descriptors":0}

Reproduction steps

See above

Expected behavior

fshc.exe file handle count should match handle.exe

Additional context

No response

Windows support

Windows support is currently missing, and it is arguably the biggest reason to develop such at all:
handle.exe is not open source and is no longer maintained (the author is the CTO of Microsoft now, so unlikely to pay any attention to a small project of his from decades ago).

The following Windows API functions seem relevant:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.