kika
kika
  • 发布:2016-08-15 11:58
  • 更新:2016-08-15 12:19
  • 阅读:2813

摄像头采集图像,如何限制内存使用空间

分类:HTML5+

真机联调,报内存不够用,无法扩大

问下,如果可以预先设置或者申请运行内存,怎么设置。
另一个思路是能否限制拍摄照片大小 < 1M?

如下是报错信息

Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 33554432, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0  at blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:181  
 Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 33554432, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0  at blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:184  
 warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling at blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:184  
 Uncaught abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 33554432, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error  
     at jsStackTrace (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:1063:13)  
     at stackTrace (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:1080:22)  
     at abort (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:95964:44)  
     at abortOnCannotGrowMemory (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:1120:3)  
     at enlargeMemory (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:1124:3)  
     at Function.Runtime.dynamicAlloc (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:376:202)  
     at _sbrk (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:5005:28)  
     at _malloc (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:91569:15)  
     at __Znwj (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:94741:9)  
     at __ZNSt3__16vectorIhNS_9allocatorIhEEE8__appendEjRKh (blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:16588:10) at blob:file%3A///de163a37-bf24-4e51-9df9-ee22df7fcb48:5180
2016-08-15 11:58 负责人:无 分享
已邀请:
赵梦欢
  • kika (作者)

    这个方法不错~感谢!

    2016-08-15 22:47

该问题目前已经被锁定, 无法添加新回复