为什么我会得到 Ice::MemoryLimitException,即使使用 Ice.MessageSizeMax=2000000

发布于 2024-12-20 09:05:09 字数 865 浏览 1 评论 0原文

您好,我使用 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 技术交流群。

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

发布评论

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

评论(2

玩世 2024-12-27 09:05:09

我相信 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)

忘你却要生生世世 2024-12-27 09:05:09

在服务器端打开 Ice.Warn.Connections 并查看日志。还要确保正确应用客户端最大消息大小。我在客户端上设置 Ice.MessageSizeMax 如下,

Ice.Properties properties = Ice.Util.createProperties();
properties.setProperty("Ice.MessageSizeMax", "2097152");//2gb in kb
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = properties;
Ice.Communicator communicator = Ice.Util.initialize(initData);

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,

Ice.Properties properties = Ice.Util.createProperties();
properties.setProperty("Ice.MessageSizeMax", "2097152");//2gb in kb
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = properties;
Ice.Communicator communicator = Ice.Util.initialize(initData);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文