2

I've installed Strawberry perl x64 on Windows, but it seems to have a memory limit of 256 MB. My perl script reasonably uses about 500MB of memory (does some calculations over linguistics corpora), but after consuming 256MB, perl terminates with message:

Out of memory during request for 4088 bytes, total sbrk() is 267954176 bytes!

Can the limit be increased somewhere? my machine has 18GB RAM and it should not be a problem to use it on x64 platform, but I can't find where to configure it.

Thanks for help.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
amik
  • 5,613
  • 3
  • 37
  • 62
  • that's weird, perl itself has no such limit. Could external resource limits be in effect? – amon Mar 27 '14 at 22:32
  • How are you running Perl? Are you using Cygwin? Strawberry Perl run directly from a Windows command window has a limit way above 256MB – Borodin Mar 27 '14 at 22:33
  • `sbrk()` is a function to increase the total memory allocated to the program. So your program failed while it was trying to allocate an additional 256MB, not trying to allocate the first 256 MB. – mob Mar 28 '14 at 00:09
  • 1
    @mob: The message says it's trying to allocate another 4KB having already allocated 256KB. But `sbrk` is a Unix system call and doesn't exist on Windows so I'm puzzled. – Borodin Mar 28 '14 at 01:02
  • Well, 1) I've looked into task manager and perl actually crashes on 256MB consumed memory, no matter what sbrk() means. – amik Mar 29 '14 at 11:54
  • 2) The version that made the problem was also executed directly from command line, but it was probably some version of perl distributed with an utility (I don't know which one), as I posted as a comment to the next answer, the strawberry 64bit perl fixed it. – amik Mar 29 '14 at 11:55

2 Answers2

0

You may be able to allow the program more memory usage, etc. by setting it's priority on Windows.

Ctrl+shift+Esc -> Taskbar -> Processes -> YourProgramName.exe-> Right Click (On Program)-> Set Priority -> Choose a performance level

I would suggest High Performance.

This tells Windows what programs it should allocate memory to.

Imperial Knight
  • 51
  • 2
  • 2
  • 7
  • It did not help, but thanks to you I've discovered that I was accidentally executing another, 32bit version of perl, which was on my windows path. So the problem is solved for now, the 64bit strawberry perl doesn't crash on low memory, but I'm still curious if its possible to configure the limit. – amik Mar 27 '14 at 23:12
  • 2
    @amik: Please post your solution as an answer so that others with the same problem can see it, and so that it is clear that the question has been resolved. – Borodin Mar 27 '14 at 23:17
  • Glad I could supply some information to solving your problem. – Imperial Knight Mar 27 '14 at 23:26
  • Well, it's still not "solved", it's solved for me because the 64bit version works fine, but there is still obviously some memory limit which I don't know how to configure. – amik Mar 29 '14 at 11:53
0

I met this question, too. I used 32bit version Perl 5.8.9 to integrate multiple files but it broke because of the limit of memory. There is a wired thing that the momory used by computer is less than 60%. So I had this idea with you that this Perl program didn't use the full memory of the computer.