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. Forums
  3. DLMS Profile Generic RAM Issue

DLMS Profile Generic RAM Issue

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By novatricetechn… , 18 July, 2020
Forums
Gurux.DLMS

I am trying to read Load profile data from profile generic.I can read all data from capture objects and buffer.I am using ESP32 controller and C language.
but when i call function for read Load profile data,Every time it will occupy some memory(RAM) which will not free by controller so after some time controller will crash due to low RAM
Same thing is happen in billing also.Please help me to solve this issue, My code is as Below.

oa_init(&objects);
ret = oa_getObjects(&_meterSettings.objects, DLMS_OBJECT_TYPE_PROFILE_GENERIC, &objects);
dlmsbb_init(&ba);

for (pos = 0; pos != objects.size; ++pos)
{
oa_getByIndex(&objects, pos, (gxObject**)&pg_1);

if(OBIS Code == Profile Obis Code)
{
com_read((gxObject*)pg_1, 3); //Reading attrbute. 3
com_readRowsByEntry(pg_1, 1, 5);

for (r = 0; r != pg_1->buffer.size; ++r)
{
ret = arr_getByIndex(&(pg_1->buffer), r, (void**)& va);

for (c = 0; c != va->size; ++c)
{
va_getByIndex(va, c, &tmp);

//reading load profile data here
}
obj_clearProfileGenericCaptureObjects(&(pg_1->captureObjects));
obj_clearProfileGenericBuffer(&(pg_1->buffer));
arr_clear(&(pg_1->buffer));
arr_clearKeyValuePair(&(pg_1->buffer));
oa_empty(&objects);
bb_clear(&ba);
}
obj_clearProfileGenericCaptureObjects(&(pg_1->captureObjects));
obj_clearProfileGenericBuffer(&(pg_1->buffer));
arr_clear(&(pg_1->buffer));
arr_clearKeyValuePair(&(pg_1->buffer));
oa_empty(&objects);
bb_clear(&ba);
}
}

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,

I believe that there are capture objects that are not in _meterSettings.objects. You need to release them like this:

oa_clear(&_meterSettings.releasedObjects);

Other problem is that you are releasing buffer after each row and I believe this is the issue here.
You need to release buffers after you have loop all the rows.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
  • dw772
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin