ryouta

ryouta

Should I be concerned about many processes running?

Hi, I have been learning elixir lately and did some hands. All I did was create some exs files and ran them. After a while I ran below command on shell

Process.info()

This returned a list of so many PIDs. I was wondering why a lot of processes have been created even though I haven’t anything big with elixir?

Result obtained after running the above command

[#PID<0.0.0>, #PID<0.1.0>, #PID<0.2.0>, #PID<0.3.0>, #PID<0.4.0>, #PID<0.5.0>,
 #PID<0.6.0>, #PID<0.7.0>, #PID<0.8.0>, #PID<0.11.0>, #PID<0.43.0>,
 #PID<0.45.0>, #PID<0.46.0>, #PID<0.47.0>, #PID<0.49.0>, #PID<0.50.0>,
 #PID<0.51.0>, #PID<0.52.0>, #PID<0.53.0>, #PID<0.55.0>, #PID<0.56.0>,
 #PID<0.57.0>, #PID<0.58.0>, #PID<0.59.0>, #PID<0.60.0>, #PID<0.61.0>,
 #PID<0.62.0>, #PID<0.63.0>, #PID<0.64.0>, #PID<0.65.0>, #PID<0.66.0>,
 #PID<0.67.0>, #PID<0.68.0>, #PID<0.69.0>, #PID<0.70.0>, #PID<0.71.0>,
 #PID<0.72.0>, #PID<0.73.0>, #PID<0.74.0>, #PID<0.75.0>, #PID<0.76.0>,
 #PID<0.81.0>, #PID<0.82.0>, #PID<0.85.0>, #PID<0.86.0>, #PID<0.87.0>,
 #PID<0.88.0>, #PID<0.89.0>, #PID<0.90.0>, #PID<0.91.0>, ...]

Can someone help me understand this? Are these beam vm processes and considered as normal?

Elixir version - 1.18.4

OS - macOS

Marked As Solved

josevalim

josevalim

Creator of Elixir

Welcome! That’s completely expected, since Erlang and Elixir itself are designed around processes, and pretty much every dependency that you use. However, they are very lightweight and you can create millions of them. For example, the Livebook application has 300+ processes on boot, and that’s normal (and many of them are idle anyway, waiting for a message). :slight_smile:

Also Liked

olivermt

olivermt

This depends entirely what code you ran and is hard to answer generically. But yes a supervised app will make a few processes.

lud

lud

The number of processes is not a concern.

The number of processes doing memory intensive stuff at the same time could be a problem :slight_smile:

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement