为什么我会得到 Ice::MemoryLimitException,即使使用 Ice.MessageSizeMax=2000000
您好,我使用 Zeroc Ice 通信库 (v3.4.2) 编写了一个 C# 客户端/服务器应用程序。
我正在从服务器传输一系列对象,然后将它们以表格格式显示在客户端中。够简单的。
我定义了以下切片类型
enum DrawType { All, Instant, Raffle };
struct TicketSoldSummary {
int scheduleId;
DrawType dType;
string drawName;
long startDate;
long endDate;
string winningNumbers;
int numTicket;
string status;
};
sequence<TicketSoldSummary> TicketSoldSummaryList;
interface IReportManager {
[..]
TicketSoldSummaryList getTicketSoldSummary(long startTime, long endTime);
};
当我调用此方法时,它通常工作正常,但偶尔(大约 25% 的时间)调用者会收到 Ice::MemoryLimitException。我们通常一次运行 2-3 个客户端。
我在互联网上搜索答案,并被告知要增加 Ice.MessageSizeMax,我照做了。我已将 MessageSizeMax 增加到 2,000,000 Kb,但这没有什么区别,我只是用 31,000 条记录(大约 1.8 Megs 数据)进行了测试,但仍然得到 Ice.MemoryLimitException。 1.8兆不是很大!
是我做错了什么还是 Zeroc Ice 存在错误?
非常感谢任何可以提供帮助的人。
Hi I have written a C# client/server application using the Zeroc Ice communication libary (v3.4.2).
I am transferring a sequence of objects from the server which are then displaying them in the client in a tabular format. Simple enough.
I defined following slice types
enum DrawType { All, Instant, Raffle };
struct TicketSoldSummary {
int scheduleId;
DrawType dType;
string drawName;
long startDate;
long endDate;
string winningNumbers;
int numTicket;
string status;
};
sequence<TicketSoldSummary> TicketSoldSummaryList;
interface IReportManager {
[..]
TicketSoldSummaryList getTicketSoldSummary(long startTime, long endTime);
};
When I call this method it usually works fine, but occasionally (approx 25% of the time) the caller gets a Ice::MemoryLimitException. We are usually running 2-3 clients at a time.
I searched on the Internet for answers and I was told to increase Ice.MessageSizeMax, which I did. I have increased MessageSizeMax right up to 2,000,000 Kb, but it made no difference, I just did a test with 31,000 records (approximately 1.8 Megs of data) and still get Ice.MemoryLimitException. 1.8 Megs is not very big!
Am I doing something wrong or is there a bug in Zeroc Ice?
Thanks so much to anyone that can offer some help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信 MessageSizeMax 需要在客户端和服务器端进行配置。还启用最大值 (3) 的跟踪并检查消息的大小(在线路上)
I believe MessageSizeMax needs to be configured on the client as well as the server side. Also have tracing enabled with max value (3) and check the size of the messages (on the wire)
在服务器端打开 Ice.Warn.Connections 并查看日志。还要确保正确应用客户端最大消息大小。我在客户端上设置 Ice.MessageSizeMax 如下,
Turn on Ice.Warn.Connections on the server side and see the logs. Also make sure the client max message size gets applied correctly. I set Ice.MessageSizeMax on the client as below,