Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Insufficient Memory In GXByteBuffer When "Peek" Property Set To True

Insufficient memory in GXByteBuffer when "Peek" property set to true

By lah , 26 September, 2024
Forums
Gurux.DLMS

Hi,

When I try to read captured objects and period from profile in one request using Client.ReadList method (attribute 3 and 4) the parsing of the values is failing without any errors. In the GXReplyData object we see correct response like this:

000119020412000809060000010000FF0F0212000002041200030906000060F00CFF0F12120000020412000509060101010400FF0F03120000020412000509060101020400FF0F03120000020412000509060101050400FF0F03120000020412000509060101060400FF0F03120000020412000509060101070400FF0F03120000020412000509060101080400FF0F03120000020412000509060101090400FF0F03120000020412000309060101010800FF0F02120000020412000309060101020800FF0F02120000020412000309060101050800FF0F02120000020412000309060101060800FF0F02120000020412000309060101070800FF0F02120000020412000309060101080800FF0F02120000020412000309060101090800FF0F02120000020412000309060101150800FF0F02120000020412000309060101290800FF0F021200000204120003090601013D0800FF0F02120000020412000309060101160800FF0F021200000204120003090601012A0800FF0F021200000204120003090601013E0800FF0F021200000204120003090601010F0800FF0F02120000020412000309060101800800FF0F021200000204120003090601010A0800FF0F02120000000600000384

If you add 0C02 to above frame it is valid response, 0C - ReadResponse 02 - 2 elements in the sequence received.

When doing this where "values" is "List<object>" the enumerableValue for above frame will just have two null entries.
if (replyData.Value is IEnumerable<object> enumerableValue)
{
values.AddRange(enumerableValue);
}
"values" is than later parsed to Client.UpdateValues method.

Then in the gurux code we noticed that on GXReplyData there is "Peek" parameter that needs to be set to true if the "Count" property of that objects needs to be used. If we set it to true we get below error:

[2024-09-26 09:57:34.2938] Failed sequenceex => System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
at Gurux.DLMS.GXByteBuffer.GetUInt8(Int32 index)
at Gurux.DLMS.GXByteBuffer.GetUInt8()
at Gurux.DLMS.GXDLMSClient.ParseSNObjects(GXByteBuffer buff, Boolean onlyKnownObjects, Boolean ignoreInactiveObjects)
at Gurux.DLMS.GXDLMSClient.ParseObjects(GXByteBuffer data, Boolean onlyKnownObjects, Boolean ignoreInactiveObjects)
at Gurux.DLMS.GXDLMSClient.ParseObjects(GXByteBuffer data, Boolean onlyKnownObjects)

Is there an issue of how the "Count" property of GXReplyData is tracked or are we doing something wrong?

The issues above appear when we try to read meters connected via HDLC and using short name association.

Let me know if you need more information.

Profile picture for user Kurumi

Kurumi

1 year 8 months ago

Hi, I need the complete hex…

Hi,

I need the complete hex trace from this. Without that, it's not possible to verify this.

BR,
Mikko

lah

1 year 8 months ago

Hi, This is a download link…

Hi,

This is a download link for complete logs from our software

https://enerdat2-my.sharepoint.com/:f:/g/personal/m_lah_enerdat_com/EmS…

There are two logs inside, one for where we set "Peek" property of GXReplyData to true and one where this is set to false and we request attribute 3 and 4 of profile in one request from the meter.
I have left comments in the logs so it is more clear what are we doing.

lah

1 year 7 months ago

Hi, Any news maybe on this…

Hi,

Any news maybe on this topic?

What we are trying to achieve is to read any combination of registers or attributes on meter with HDLC connection with multi referencing to shorten communication time.
In the latest possible gurux dlms version (9.0.2409.2401) this works correctly only when reading profile buffer (attribute 2 of class id 7).

Let me know if you need more information from me or if I can clarify anything more in detail.

Profile picture for user Kurumi

Kurumi

1 year 7 months ago

Hi, I also need RR frame…

Hi,

I also need RR frame bytes to verify this. Now there is only "Sending RR frame" in the log file. Can you add Receiver Ready also as a hex so I can verify this?

BR,
Mikko

lah

1 year 7 months ago

Hi, This is a download link…

Hi,

This is a download link to logs where I also logged RR frame: https://enerdat2-my.sharepoint.com/:f:/g/personal/m_lah_enerdat_com/Eh4…

I have again added comments to logs so it is easier to understand what we are doing.

Thank you for looking into this.

lah

1 year 6 months ago

Hi Mikko, Do you maybe have…

Hi Mikko,

Do you maybe have any update regarding this issue? Is there any more information that I should provide?

Download links for logs are still valid.

Regards

Profile picture for user Kurumi

Kurumi

1 year 6 months ago

Hi, I forget to answer this…

Hi,

I forget to answer this. Can you send the log using the client example trace or with Wireshark? There is an issue that makes it impossible to check the bytes.

BR,
Mikko

lah

1 year 5 months ago

Hi, This is a download link…

Hi,

This is a download link for wireshark traces and logs: https://enerdat2-my.sharepoint.com/:f:/g/personal/m_lah_enerdat_com/Eno….
I have added comments to the logs so that you have an easier understanding of what is happening.

Thank you for looking into this.

Regards

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin