<div dir="ltr">my suspicion (without having run that code yet) is that you're running out of memory somehow, and your computer's becoming slow as programs are getting paged in and out. You might try starting the program while windows' process monitor is running and watching the CPU and memory graphs to see if there are any unnatural or explosive spikes. If you've compiled with wx in your otp installation, then you could also start observer (type o() in the shell before kicking off your program) and watch the pretty lights while it runs.<div><br></div><div>10,000 erlang processes is not a heck of a lot, unless each of those processes, say, recurses over a megabyte of local state or, unbeknownst to you, starts another 100 processes each or tries to send every other process a message.<br><div><br></div><div>epmd is, as you guess, super unlikely to be the root cause of any problems; it's just a name service. </div><div><br></div><div>F.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 7:31 AM, Bill Durksen <span dir="ltr"><<a href="mailto:bdurksen@vaxxine.com" target="_blank">bdurksen@vaxxine.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi there,<br>
<br>
To learn Erlang, I have recently switched from "learn you some
Erlang" (<a href="http://learnyousomeerlang.com" target="_blank">http://learnyousomeerlang.com</a>) to building actual programs.<br>
<br>
My first real Erlang program was a multi-process, multi-host,
wxWidgets-based file-transfer application with 768 lines of Erlang
code.<br>
I was surprised how simple it is to get this distributed
functionality built, cleanly, in Erlang.<br>
Much appreciation goes to [erlang-questions]-subscribers, who guided
me to various solutions when I needed an Erlang implementation of
the Singleton design pattern.<br>
The 'ets' dictionary solution worked for me, after I figured it out.<br>
<br>
Currently, I am finishing a Maze-generation program (114 lines of
packed Erlang code), and have put the final version up on the
Rosetta Code web-site.<br>
(see the <a href="http://rosettacode.org/wiki/Maze_generation#Erlang" target="_blank">http://rosettacode.org/wiki/Maze_generation#Erlang</a>
...Alternative example (implemented with 2 diagraphs)).<br>
<br>
From doing this experiment, I have a few questions:<br>
<br>
1. The original Erlang maze-generation code (same Rosetta web-site
page) used a light-weight process for each vertex in the maze.<br>
This is a very good example of how the Erlang process
architecture can support many light-weight processes.<br>
I was surprised that it actually worked, until I tried
generating a bigger maze.<br>
When I used the original Erlang maze example to generate a maze
of 25 columns x 4000 rows, it brought my PC down to a crawl.<br>
I couldn't do anything (I am running Windows 7 64-bit on 9 GB of
RAM) until I killed EPMD from Task Manager.<br>
Even after killing EPMD, it took quite a while for the computer
to get back to normal again, which indicates that it may not have
been EPMD causing the problem.<br>
<br>
Here is the question (part a): should I expect EPMD (or the WERL
process) to slow to a crawl with 100,000 Erlang processes running on
a single machine?<br>
(part b): If yes, what would
be the Erlang programmer's defence tactic against this scenario?<br>
<br>
2. 114 packed lines of Erlang code just seems to over-coded for such
a powerful language.<br>
Not being an expert, yet, in all the nuances of Erlang, can
someone suggest ways I can decrease maze.erl code down to 99 lines
or less, without cheating (removing too many newlines)?<br>
<br>
Thanks,<br>
Bill<br>
<br>
<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;letter-spacing:normal;line-height:20px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:rgb(255,255,255)"></span>
</div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>