高速率数据流和内存不足

发布于 2024-08-18 21:36:31 字数 269 浏览 5 评论 0原文

我有一个程序,可以以 800 Mb/s 的速度累积来自网络接口的流量。该程序由Delphi开发,同样是32​​位平台(Delphi不支持64位架构)。 我正在内存(RAM)上写入接收到的日期,一段时间后(未知,取决于接收到的数据),将接收到的数据块(未知大小,取决于接收到的数据)写入硬盘并释放内存(RAM) 。

当我运行该应用程序时,一段时间后,它会抛出“内存不足”异常。我应该怎么做才能防止这种异常?

I have a program that accumulates traffic from network interface in 800 Mb/s. This program is developed by Delphi, also in 32bit platform(Delphi does not support 64bit architecture).
I'm writing received date on the memory(RAM) and after a while (unknown and depends on received data), write a block of received data (unknown size and depends on received data) into hard disk and free the memory(RAM).

When I run the application, after some times, it throws "Out Of Memory" exception. What should I do to prevent this exception?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯了 2024-08-25 21:36:31

这是一个非常高的数据速率 - 我假设它是兆位(100 兆字节/秒)。只有最快的 SSD 才能跟上,而且前提是您的编程效率为 100%。检查顺序写入速度表:http://www.anandtech.com/storage/showdoc.aspx?i=3702&p=9" rel="nofollow noreferrer"> anandtech.com/storage/showdoc.aspx?i=3702&p=9

如果您可以投入更多 RAM 来解决该问题,我建议您进入 64 位模式并一次性分配整个 RAM 缓冲区。

That's a very high data rate - I assume it's Mbits (100 MBytes/second). Only the fastest SSDs will be able to keep up, and that's only if your programming is 100% efficient. Check the table of sequential write speeds: http://www.anandtech.com/storage/showdoc.aspx?i=3702&p=9

If you can throw more RAM at the problem, I'd suggest going to 64-bit mode and allocating your entire RAM buffer all at once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文