<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for the input. It will be a few days before I can do any serious testing, but I can answer some of your questions now.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
IOhannes: yes, I upgraded PD, my externals, and my OS, all at the same time. I'll try it out with various different versions of the same and let you know what happens. But just as a heads-up, it's quite possible that I am trying to load more than 10,000 abstractions
 at once. Quite difficult to count them though!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If neither the externals nor the OS turn out to be the problem, I'll try to come up with a simple test case and get back to you.</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Pd-list <pd-list-bounces@lists.iem.at> on behalf of IOhannes m zmölnig <zmoelnig@iem.at><br>
<b>Sent:</b> 21 May 2018 20:50<br>
<b>To:</b> pd-list@lists.iem.at<br>
<b>Subject:</b> Re: [PD] "too many open files" error in 0.48.1</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 05/21/2018 09:37 PM, ub@xdv wrote:<br>
> On 21.05.2018 20:54, Claude Heiland-Allen wrote:<br>
>><br>
>><br>
>> On 21/05/18 19:35, ub@xdv wrote:<br>
>>> hello,<br>
>>><br>
>>> On 20.05.2018 06:50, Liam Goodacre wrote:<br>
>>>> In 0.48.1 on Ubuntu, I'm getting a horrible scenario where PD refuses to<br>
>>>> open patches or create any more abstractions for me. I get an error<br>
>>>> message saying "too many open files". Granted I have a lot open, but<br>
>>>> this is a serious problem as it means I can't access all of my old<br>
>>>> performances. They worked fine in 0.47.<br>
>>>><br>
>>>> Any ideas?<br>
>>> this is not really a problem with pd<br>
>><br>
>> I disagree. The most common cause of "too many open files" is a bug in<br>
>> closing files properly, <br>
<br>
intuitively i would agree.<br>
<br>
> possible. never occured to me. is it in the issue tracker?<br>
<br>
no (afaik). it hasn't been reported before.<br>
<br>
> <br>
>> because 1024 simultaneously-open files should be<br>
>> enough for most use cases.definitely, but when someone says "Granted I have a lot open", that<br>
> could be an understatement. or a regression of some sort.<br>
<br>
so i did a test run, with some heavily embedded abstraction, that is<br>
loaded a total of 10000 times.<br>
$ ulimit -Sn<br>
1024<br>
$ valgrind --track-fds=yes pd -noprefs -oss -nosound -nomidi -nrt<br>
-stderr -open test.pd<br>
[...]<br>
==29030== FILE DESCRIPTORS: 3 open at exit.<br>
==29030== Open file descriptor 2: /dev/pts/12<br>
==29030==    <inherited from parent><br>
==29030==<br>
==29030== Open file descriptor 1: /dev/pts/12<br>
==29030==    <inherited from parent><br>
==29030==<br>
==29030== Open file descriptor 0: /dev/pts/12<br>
==29030==    <inherited from parent><br>
==29030==<br>
[...]<br>
$<br>
<br>
so there seems to be neither a temporary file-handle leak (because my<br>
10000 abstractions load just fine) nor an absolute file-handle leak<br>
(since the only handles that are left open by the program are stdin,<br>
stdout, stderr)<br>
<br>
<br>
so i guess there must be something wrong with the patch.<br>
<br>
@liam are there any externals in use? did you upgrade the entire system<br>
or just Pd? when using an older version of Pd, does the problem persist?<br>
<br>
gfmtdsar<br>
IOhannes<br>
<br>
<br>
> <br>
> <br>
>><br>
>><br>
>> Claude<br>
>><br>
>>> , but with your shell- or system<br>
>>> configuration limiting the number of open file descriptors.<br>
>>><br>
>>> check your current shell-limit with<br>
>>> ulimit -Sn<br>
>>> -S is for soft limit (you can lower, but not raise, the hard limit).<br>
>>> raise the limit in your shell with<br>
>>> ulimit -n 65536<br>
>>> start pd from that shell and see if the situation improves.<br>
>>><br>
>>> if that doesn't help, you can check the kernel limits with<br>
>>> cat /proc/sys/fs/file-nr<br>
>>> which returns 3 numbers, the first of which is the number of open files,<br>
>>> the last of which is the limit.<br>
>>><br>
>>> increase the value of "nofile" in  /etc/security/limits.conf<br>
>>> do<br>
>>> sudo sysctl -p<br>
>>><br>
>>> additional steps are required to make these settings permanent, the<br>
>>> ulimit -n 65536 would have to go into your .bashrc so it's executed at<br>
>>> system startup. if you normally start pd from your GUI you'd have to<br>
>>> restart your system (actually just xorg) so your master shell knows<br>
>>> about the new value. there's other ways, one of which would be to start<br>
>>> pd from a wrapper script, or probably gnome provides that sort of<br>
>>> environmental setup for it's program shortcuts.<br>
>>><br>
>>> there's more information<br>
>>> -<br>
>>> <a href="https://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user">
https://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user</a><br>
>>><br>
>>> -<br>
>>> <a href="https://unix.stackexchange.com/questions/29577/ulimit-difference-between-hard-and-soft-limits">
https://unix.stackexchange.com/questions/29577/ulimit-difference-between-hard-and-soft-limits</a><br>
>>><br>
>>><br>
>>> hope that helps ... cheers,<br>
>>> ub<br>
>>><br>
>>>> Liam<br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Pd-list@lists.iem.at mailing list<br>
>>>> UNSUBSCRIBE and account-management -><br>
>>>> <a href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a><br>
>>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Pd-list@lists.iem.at mailing list<br>
>>> UNSUBSCRIBE and account-management -><br>
>>> <a href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a><br>
> <br>
> <br>
> _______________________________________________<br>
> Pd-list@lists.iem.at mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list">
https://lists.puredata.info/listinfo/pd-list</a><br>
> <br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>