Ask Your Question
0

How to increase TOTAL_MEMORY for OpenCV JS?

asked 2019-01-14 06:11:38 -0600

Lucy8 gravatar image

I am using *opencv.js *. After some time working (about 1 min) it crashes and in the browser console, I see the following.

Uncaught abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 2147221504, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 "). Build with -s ASSERTIONS=1 for more info.

How can I increase TOTAL_MEMORY or set ALLOW_MEMORY_GROWTH = 1 for Opencv JS

I built opencv.js as it's described here

edit retag flag offensive close merge delete

Comments

Hello,

I am getting this error after building opencvjs and runs code well for 1 to 2 minutes, but throws OOM abort after 1 or 2 minutes.

Please help me on this issue.

https://answers.opencv.org/question/2...

vasanthahr gravatar imagevasanthahr ( 2019-09-18 21:46:10 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2020-05-03 17:25:29 -0600

kpachinger gravatar image

delete mats and similarly allow GC when possible. operate on reduced media sizes. use inspector/profiler to watch memory spikes as they relate to function calls and/or GPU on timeline.

edit flag offensive delete link more
1

answered 2019-01-18 02:26:25 -0600

berak gravatar image

updated 2019-01-18 02:27:38 -0600

you'll have to modify CmakeLists.txt and rebuild it.

good luck !

edit flag offensive delete link more

Comments

Thank you! I'll try it

Lucy8 gravatar imageLucy8 ( 2019-01-18 06:48:58 -0600 )edit

Hello,

I am getting this error after building opencvjs and runs code well for 1 to 2 minutes, but throws OOM abort after 1 or 2 minutes.

Please help me on this issue.

https://answers.opencv.org/question/2...

vasanthahr gravatar imagevasanthahr ( 2019-09-18 21:46:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-01-14 06:11:38 -0600

Seen: 1,376 times

Last updated: May 03 '20