ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* SOLVED: too many open files
@ 2013-08-15 15:48 Henning Hraban Ramm
  2013-08-15 16:09 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Henning Hraban Ramm @ 2013-08-15 15:48 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi again,

in my current songbook project I use t-filter with LilyPond as shown in http://wiki.contextgarden.net/LilyPond with latest beta MkIV on OSX.

Every line (system) of notes is included as its own PDF to leave the page breaking to ConTeXt. But since I have some hundred songs with each a few lines, it sums up...

I guess ConTeXt keeps every externalfigure open, since I get this error:

pages           > flushing realpage 70, userpage 70
(c_helpmesee.tex
structure       > sectioning > TitelKlein @ level 2 : 0.83 -> Help Me See
GNU LilyPond 2.16.2
ERROR: In procedure open-file:
ERROR: Too many open files: "/Applications/music/LilyPond.app/Contents/Resources/bin/../share/guile/1.8/ice-9/r4rs.scm"
LILYPOND        > name='lilytemp/prd_alle-temp-lilypond-c_helpmesee.pdf'
LILYPOND        > including system no.1
LILYPOND        > including system no.2
LILYPOND        > including system no.3
LILYPOND        > including system no.4
LILYPOND        > including system no.5
) (c_hochaufdem.tex </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-1.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-2.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-3.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdfI/O Error: Couldn't open file '/Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdf': Too many open files.

!LuaTeX error: xpdf: reading PDF image failed
 ==> Fatal error occurred, no output PDF file produced!


It works with songbook excerpts (some 30 songs). I don't understand if the error is really from LilyPond or from LuaTeX (I guess the former), and how I would be able to increase the number of possible files (in bash on OSX 10.8.4). So probably it's more a general Unix question than a ConTeXt one, but anyway...

ANALYSIS:
$ ulimit -n
256
$ sysctl kern.maxfiles
kern.maxfiles: 12288
$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 10240

SOLUTION:
$ ulimit -S -n 2048

(Properly describing a problem often helps to solve it. I send this for the records, in case someone runs into the same.)


Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SOLVED: too many open files
  2013-08-15 15:48 SOLVED: too many open files Henning Hraban Ramm
@ 2013-08-15 16:09 ` Hans Hagen
  2013-08-15 16:23 ` Aditya Mahajan
  2016-06-19 19:47 ` Mojca Miklavec
  2 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2013-08-15 16:09 UTC (permalink / raw)
  To: ntg-context

On 8/15/2013 5:48 PM, Henning Hraban Ramm wrote:
> Hi again,
>
> in my current songbook project I use t-filter with LilyPond as shown in http://wiki.contextgarden.net/LilyPond with latest beta MkIV on OSX.
>
> Every line (system) of notes is included as its own PDF to leave the page breaking to ConTeXt. But since I have some hundred songs with each a few lines, it sums up...
>
> I guess ConTeXt keeps every externalfigure open, since I get this error:
>
> pages           > flushing realpage 70, userpage 70
> (c_helpmesee.tex
> structure       > sectioning > TitelKlein @ level 2 : 0.83 -> Help Me See
> GNU LilyPond 2.16.2
> ERROR: In procedure open-file:
> ERROR: Too many open files: "/Applications/music/LilyPond.app/Contents/Resources/bin/../share/guile/1.8/ice-9/r4rs.scm"
> LILYPOND        > name='lilytemp/prd_alle-temp-lilypond-c_helpmesee.pdf'
> LILYPOND        > including system no.1
> LILYPOND        > including system no.2
> LILYPOND        > including system no.3
> LILYPOND        > including system no.4
> LILYPOND        > including system no.5
> ) (c_hochaufdem.tex </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-1.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-2.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-3.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdfI/O Error: Couldn't open file '/Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdf': Too many open files.
>
> !LuaTeX error: xpdf: reading PDF image failed
>   ==> Fatal error occurred, no output PDF file produced!
>
>
> It works with songbook excerpts (some 30 songs). I don't understand if the error is really from LilyPond or from LuaTeX (I guess the former), and how I would be able to increase the number of possible files (in bash on OSX 10.8.4). So probably it's more a general Unix question than a ConTeXt one, but anyway...
>
> ANALYSIS:
> $ ulimit -n
> 256
> $ sysctl kern.maxfiles
> kern.maxfiles: 12288
> $ sysctl kern.maxfilesperproc
> kern.maxfilesperproc: 10240
>
> SOLUTION:
> $ ulimit -S -n 2048
>
> (Properly describing a problem often helps to solve it. I send this for the records, in case someone runs into the same.)

afaik the limit for simultaneous open pdf files in luatex is 2K so it's 
indeed your operating system

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SOLVED: too many open files
  2013-08-15 15:48 SOLVED: too many open files Henning Hraban Ramm
  2013-08-15 16:09 ` Hans Hagen
@ 2013-08-15 16:23 ` Aditya Mahajan
  2013-08-17 15:13   ` Henning Hraban Ramm
  2016-06-19 19:47 ` Mojca Miklavec
  2 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2013-08-15 16:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 15 Aug 2013, Henning Hraban Ramm wrote:

> in my current songbook project I use t-filter with LilyPond as shown in http://wiki.contextgarden.net/LilyPond with latest beta MkIV on OSX.

OT: The thriddata.parselilypondfile(..) function is convoluted. Instead of

  for ts in io.lines(scname) do
      syco = ts*1
   end

you should use

   syco = tonumber(io.loaddata(scname)) or 0

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SOLVED: too many open files
  2013-08-15 16:23 ` Aditya Mahajan
@ 2013-08-17 15:13   ` Henning Hraban Ramm
  0 siblings, 0 replies; 6+ messages in thread
From: Henning Hraban Ramm @ 2013-08-17 15:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2013-08-15 um 22:23 schrieb Aditya Mahajan <adityam@umich.edu>:

> 
> OT: The thriddata.parselilypondfile(..) function is convoluted. Instead of
...
> 
> you should use
> 
>  syco = tonumber(io.loaddata(scname)) or 0

Thank you, I changed it.


Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SOLVED: too many open files
  2013-08-15 15:48 SOLVED: too many open files Henning Hraban Ramm
  2013-08-15 16:09 ` Hans Hagen
  2013-08-15 16:23 ` Aditya Mahajan
@ 2016-06-19 19:47 ` Mojca Miklavec
  2016-06-19 21:49   ` Hans Hagen
  2 siblings, 1 reply; 6+ messages in thread
From: Mojca Miklavec @ 2016-06-19 19:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I found an old thread while fighting with the problem of
    luatex I/O Error: Couldn't open file 'foo.pdf': Too many open files.

On 15 August 2013 at 17:48, Henning Hraban Ramm wrote:
> Hi again,
>
> in my current songbook project I use t-filter with LilyPond as shown in http://wiki.contextgarden.net/LilyPond with latest beta MkIV on OSX.
>
> Every line (system) of notes is included as its own PDF to leave the page breaking to ConTeXt. But since I have some hundred songs with each a few lines, it sums up...
>
> I guess ConTeXt keeps every externalfigure open, since I get this error:
>
> pages           > flushing realpage 70, userpage 70
> (c_helpmesee.tex
> structure       > sectioning > TitelKlein @ level 2 : 0.83 -> Help Me See
> GNU LilyPond 2.16.2
> ERROR: In procedure open-file:
> ERROR: Too many open files: "/Applications/music/LilyPond.app/Contents/Resources/bin/../share/guile/1.8/ice-9/r4rs.scm"
> LILYPOND        > name='lilytemp/prd_alle-temp-lilypond-c_helpmesee.pdf'
> LILYPOND        > including system no.1
> LILYPOND        > including system no.2
> LILYPOND        > including system no.3
> LILYPOND        > including system no.4
> LILYPOND        > including system no.5
> ) (c_hochaufdem.tex </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-1.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-2.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-3.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdfI/O Error: Couldn't open file '/Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdf': Too many open files.
>
> !LuaTeX error: xpdf: reading PDF image failed
>  ==> Fatal error occurred, no output PDF file produced!
>
>
> It works with songbook excerpts (some 30 songs). I don't understand if the error is really from LilyPond or from LuaTeX (I guess the former), and how I would be able to increase the number of possible files (in bash on OSX 10.8.4). So probably it's more a general Unix question than a ConTeXt one, but anyway...
>
> ANALYSIS:
> $ ulimit -n
> 256
> $ sysctl kern.maxfiles
> kern.maxfiles: 12288
> $ sysctl kern.maxfilesperproc
> kern.maxfilesperproc: 10240
>
> SOLUTION:
> $ ulimit -S -n 2048
>
> (Properly describing a problem often helps to solve it. I send this for the records, in case someone runs into the same.)

Running "ulimit -S -n 2048" in fact solved the problem for me, but I
wonder if there is any better solution. (I might even have more than
256 files open in my text editor and that one doesn't complain.)

Is it possible to politely ask LuaTeX to close the files after reading them?

(It's fine if that's impossible, I can still use Hraban's workaround.)

Thank you,
    Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SOLVED: too many open files
  2016-06-19 19:47 ` Mojca Miklavec
@ 2016-06-19 21:49   ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2016-06-19 21:49 UTC (permalink / raw)
  To: ntg-context

On 6/19/2016 9:47 PM, Mojca Miklavec wrote:
> Hi,
>
> I found an old thread while fighting with the problem of
>     luatex I/O Error: Couldn't open file 'foo.pdf': Too many open files.
>
> On 15 August 2013 at 17:48, Henning Hraban Ramm wrote:
>> Hi again,
>>
>> in my current songbook project I use t-filter with LilyPond as shown in http://wiki.contextgarden.net/LilyPond with latest beta MkIV on OSX.
>>
>> Every line (system) of notes is included as its own PDF to leave the page breaking to ConTeXt. But since I have some hundred songs with each a few lines, it sums up...
>>
>> I guess ConTeXt keeps every externalfigure open, since I get this error:
>>
>> pages           > flushing realpage 70, userpage 70
>> (c_helpmesee.tex
>> structure       > sectioning > TitelKlein @ level 2 : 0.83 -> Help Me See
>> GNU LilyPond 2.16.2
>> ERROR: In procedure open-file:
>> ERROR: Too many open files: "/Applications/music/LilyPond.app/Contents/Resources/bin/../share/guile/1.8/ice-9/r4rs.scm"
>> LILYPOND        > name='lilytemp/prd_alle-temp-lilypond-c_helpmesee.pdf'
>> LILYPOND        > including system no.1
>> LILYPOND        > including system no.2
>> LILYPOND        > including system no.3
>> LILYPOND        > including system no.4
>> LILYPOND        > including system no.5
>> ) (c_hochaufdem.tex </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-1.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-2.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-3.pdf> </Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdfI/O Error: Couldn't open file '/Users/hraban/workspace/liederheft/lilytemp/prd_alle-temp-lilypond-c_helpmesee-4.pdf': Too many open files.
>>
>> !LuaTeX error: xpdf: reading PDF image failed
>>  ==> Fatal error occurred, no output PDF file produced!
>>
>>
>> It works with songbook excerpts (some 30 songs). I don't understand if the error is really from LilyPond or from LuaTeX (I guess the former), and how I would be able to increase the number of possible files (in bash on OSX 10.8.4). So probably it's more a general Unix question than a ConTeXt one, but anyway...
>>
>> ANALYSIS:
>> $ ulimit -n
>> 256
>> $ sysctl kern.maxfiles
>> kern.maxfiles: 12288
>> $ sysctl kern.maxfilesperproc
>> kern.maxfilesperproc: 10240
>>
>> SOLUTION:
>> $ ulimit -S -n 2048
>>
>> (Properly describing a problem often helps to solve it. I send this for the records, in case someone runs into the same.)
>
> Running "ulimit -S -n 2048" in fact solved the problem for me, but I
> wonder if there is any better solution. (I might even have more than
> 256 files open in my text editor and that one doesn't complain.)
>
> Is it possible to politely ask LuaTeX to close the files after reading them?

maybe object=no helps



-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-19 21:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 15:48 SOLVED: too many open files Henning Hraban Ramm
2013-08-15 16:09 ` Hans Hagen
2013-08-15 16:23 ` Aditya Mahajan
2013-08-17 15:13   ` Henning Hraban Ramm
2016-06-19 19:47 ` Mojca Miklavec
2016-06-19 21:49   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).