Closed OTP-Maintainer closed 3 years ago
mikael pettersson
said:
You're allocating 2MB on your thread's stack. I don't know how large stacks NIFs get, but 2MB on stack seems excessive. Just change that to dynamic allocation.
JIRAUSER16702
said:
yeah, change it into staic or malloc could solve this problem. and use large array is bad idea.
i also solve my problem by malloc it.
maybe it's necessary to notice that large allocating on stack may clause crash in doc. just for notice, it's really hard to debug this problem with many lib used.
and only with erl20 and after it happends, erl19 works fine.
JIRAUSER16702
said:
sry, it seems not erlang problem, i know C too less.
large array wolud clause problem is normal in C. not because of nif used.
JIRAUSER16702
said:
tks for your help. you can just close this. after change to malloc everything works fine.
JIRAUSER16702
said:
use large is not good idea.
erlang change default staick size.
in OTP 18 and early default stack size is OS dependent.
after OTP19 include OTP19 default suggested stack size is 128 kilowords.
this is set by erl arg '+sss'
Original reporter:
JIRAUSER16702
Affected version:OTP-20.0
Component:Not Specified
Migrated from: https://bugs.erlang.org/browse/ERL-1358