简体   繁体   English

“啊,啪!” 和 ASR:Chrome 中的套接字缓冲区错误中没有空间

[英]“Aw, Snap!” and ASR: No room in socket buffer errors in Chrome

I have a web application with heavy JS scripts (by heavy I mean lots of client processing which can't be done on the server side).我有一个带有大量 JS 脚本的 Web 应用程序(我的意思是大量客户端处理无法在服务器端完成)。 After 1 hour or so (not constant) of processing I get Chrome's "Aw, Snap!"经过 1 小时左右(不是恒定的)处理后,我得到 Chrome 的“啊,快!” error, I have debugged as suggest in https://superuser.com/questions/607563/how-to-determine-what-is-causing-chrome-to-show-the-aw-snap-dialogue and I noticed that everytime I get the error, the log is prompting WARNING:audio_sync_reader.cc(177)] ASR: No room in socket buffer.错误,我已按照https://superuser.com/questions/607563/how-to-determine-what-is-causing-chrome-to-show-the-aw-snap-dialogue 中的建议进行调试,我每次都注意到我收到错误,日志提示WARNING:audio_sync_reader.cc(177)] ASR: No room in socket buffer.

I strongly believe that I am kind of running out of memory, because if I open other tabs after this error I get others "Aw, Snap!"我坚信我的内存不足,因为如果我在此错误后打开其他选项卡,我会收到其他人的“噢,快!” . .

However, considering that my JS script is long and it takes a long time to throw the error, how can I identify which piece of code is raising it?但是,考虑到我的 JS 脚本很长,并且抛出错误需要很长时间,我如何确定是哪一段代码引发了它?

PS.: I also have many DOM manipulations (mainly insertions on a table) PS.: 我也有很多 DOM 操作(主要是在表上插入)

Thanks!谢谢!

Its not necessarily a certain line or a block of code.它不一定是某一行或一段代码。 Its just that your application consumes to much memory.只是您的应用程序消耗了大量内存。 That can be caused by aa memory leak, which you can identify by looking at the debuggers memory tab.这可能是由内存泄漏引起的,您可以通过查看调试器内存选项卡来识别。 If no memory is leaking you should overthink your codes structure.如果没有内存泄漏,您应该过度考虑您的代码结构。

I had a similar issue:我有一个类似的问题:

[0225/064309.871791:WARNING:audio_sync_reader.cc(175)] ASR: No room in socket buffer.: Broken pipe (32)

I was running Chrome in headless mode in a Docker container.我在 Docker 容器中以无头模式运行 Chrome。 The warning above was caused by another memory issue related to the /dev/shm shared memory space of Linux.上面的警告是由另一个与 Linux 的/dev/shm共享内存空间相关的内存问题引起的。 This page describes it in more detail:此页面对其进行了更详细的描述:

https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#tips https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#tips

Docker only allocates 64MB for /dev/shm . Docker 只为/dev/shm分配 64MB。 I suppose that Chrome use /dev/shm to store images (uncompressed) which are loaded by the current browser tab.我想 Chrome 使用/dev/shm来存储当前浏览器选项/dev/shm载的图像(未压缩)。 At least this would explain why Chrome only failed, when the website contained one or more large images.至少这可以解释为什么 Chrome 只有在网站包含一张或多张大图像时才会失败。 The ASR: No room in socket buffer. ASR: No room in socket buffer. error was only a side-effect of occupying /dev/shm with the large images.错误只是大图像占用/dev/shm的副作用。

Using the --disable-dev-shm-usage Chrome command line flag solved this issue.使用--disable-dev-shm-usage Chrome 命令行标志解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM