programing

MySQL/Connector C 라이브러리를 사용하는 C 애플리케이션은 메모리를 매우 빠르게 소비합니다.

newsource 2023. 6. 19. 21:37

MySQL/Connector C 라이브러리를 사용하는 C 애플리케이션은 메모리를 매우 빠르게 소비합니다.

저는 C 애플리케이션 내의 MySQL/Connector C 라이브러리를 활용하여 데이터베이스를 조작하는 데 성공했습니다.그러나 애플리케이션을 사용하면 메모리 사용량이 매우 많아져 실제로 사용을 고려해야 했습니다.systemd항상 활성 상태여야 하므로 시작 시 서비스로 실행될 것으로 예상되는 응용 프로그램을 관리합니다.이 문제를 더 이상 난독화하거나 복잡성을 더하기보다는 애플리케이션 내에서 문제를 해결하고 싶습니다.

  • 시스템: 라즈베리 파이 4B
  • OS: Raspbian Buster
  • SQL 라이브러리: mariadb-connector-c-3.1.7
  • 데이터베이스:MariaDB 10.3.22 서버, 로컬 호스트

일반적으로 결과 집합을 MYSQL_RES 개체에 저장하는 쿼리는 다음을 사용하여 지웁니다.mysql_free_result(sqlRes)삽입물은 아주 간단하게 보관합니다.모든 것이 기능적인 관점에서 올바르게 작동하지만 메모리 소비는 지붕을 통해 이루어집니다.이 중 많은 부분이 메인() 루프 코드의 대기 시간 때문이라고 생각하지만 115.2k로 통신하는 호스트 시스템에서 UART 연결을 논블로킹 방식으로 모니터링할 수 있기를 원합니다.

제가 코스에서 벗어난 모범 사례가 있습니까?제 초기 코드의 대부분은 여기에 설명된 것과 유사하게 개발되었습니다.저는 Raspbian에 있는 메모리 분석 애플리케이션에 익숙하지 않기 때문에 사용하지 않았습니다.

감사해요.

// MySQL/Connector C API objects for database management

MYSQL *connect;                 // MySQL object for managing connection
MYSQL_RES *sqlRes;              // When querying a results set, use this object to store them
MYSQL_ROW sqlRow;               // When iterating through results, use this object to store each
MYSQL_FIELD *sqlFields;
int mysql_query_status=0;
my_ulonglong numRows;
unsigned int numFields;

int insert_t_data(char* id, char* level, char* di)
{

 // Insert data records into database
    int strret = snprintf(insertString, 103, "INSERT INTO t_data (id, value_type, value) VALUES ('%s', '%s', '%s');", id, di, level);

    mysql_query_status = mysql_query(connect, insertString);
    if (mysql_query_status)
    {
        printf("MySQL error at Insert into t_data: %s",mysql_error(connect));
        errchk++;
        return 1;
    }

    return 0;
}

int update_tank(char* id, uint8_t sh, uint8_t sl, uint8_t ts, uint8_t alarms_anc)
{
    uint8_t hf = (alarms_anc >> 1) & 1U;

    // Insert t_data records into database
    int strret = snprintf(insertString, 100, "SELECT * FROM t WHERE description='%s' ORDER BY timestamp DESC LIMIT 1;", id);

    if ((mysql_query_status=mysql_query(connect, insertString)))      // Error in query
    {
        printf("Couldn't find existing record. Inserting new record to 't' for '%s'",id);
    }
    else      // Successful query (but not necessarily any rows)
    {
        sqlRes = mysql_store_result(connect);     // Retrieve the resulting set from this query
        numRows = mysql_num_rows(sqlRes);
        if ((sqlRes) && (numRows))
        {
            // Record already exists, proceed to update.
            mysql_free_result(sqlRes);
        }
        else
        {
            // Create a row since it wasn't there, proceed to update.
            strret = snprintf(insertString, 75, "INSERT INTO t (r_id, description) VALUES ('%d', '%s');", 4digit, id);

            mysql_query_status = mysql_query(connect, insertString);
            if (mysql_query_status)
            {
                printf("MySQL error at t: %s",mysql_error(connect));
                errchk++;
            }
        }
    }

    strret = snprintf(insertString, 150, "UPDATE t SET high='%d', low='%d', height='%d', h='%d' WHERE description='%s'", sh, sl, ts, hf, id);

    mysql_query_status = mysql_query(connect, insertString);
    if (mysql_query_status)
    {
        printf("MySQL error at t_data: %s",mysql_error(connect));
        errchk++;
        return 1;
    }

    return 0;
}

void db_connect(void)
{
    printf("Reached DB Connect.\n");
    connect = mysql_init(NULL);
    connect = mysql_real_connect(connect,SERVER,USER,PASSWORD,DATABASE,0,NULL,0);
    if ((!connect) || (connect == NULL))
    {
        printf("MySQL failed to initialize. Connection to 'db' failed.\n");
        errchk=1;           // Use errchk throughout for reconnect
    }
    else
    {
        printf("Connection successful.\n");
    }

}


int main(void)
{
    
    usleep(5000);                        // Slight delay at startup
    memset(&rbuf, '\0', sizeof(rbuf));   // Clear read buffer before communication
    bufptr=rbuf;

    db_connect();

// LOOP section ---------------

    while(TRUE)
    {
        // 1.) Read serial port for real-time updates
        // 2.) Write SQL data resulting from any updates
        // 3.) Read SQL tables for any user actions/updates
        // 4.) Write serial actions/cmds

        if (errchk > 10) {
            mysql_close(connect);
            sleep(10);
            errchk=0;
            db_connect();
        }

        usleep(100000); // Wait 100ms - This setting consumes 0.1% memory every 50 sec
        // usleep(10000);  // Wait 10 ms - Ideal - This setting consumes 0.1% memory every 10 sec 

        check_uart();   // This is a function that can trigger SQL inserts/updates

        // if new data detected, then...
        insert_t_data(id,level,di); 
        // if new updates needed, then...
        update_tank(id, sh, sl, size, alarms);

    }

    close(serial_port);
    mysql_close(connect);
}


편집 1: 발그랜드 로그 광기

pi@raspberrypi:~/beehive/bin/Debug $ valgrind --leak-check=yes ./beehive
==6693== Memcheck, a memory error detector
==6693== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==6693== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==6693== Command: ./beehive
==6693== 
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so:
--6693-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so:
--6693-- Last block truncated in .debug_info; ignoring
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401A5D0: index (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401A5D4: index (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4008040: _dl_dst_count (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4008288: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401AA80: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401AA84: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4017F68: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4017F74: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B5E8: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B608: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B618: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B634: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B63C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B664: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B664: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B68C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6A0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6A4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6B0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x40180A4: calloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4017FA8: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401A160: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Syscall param mmap2(start) contains uninitialised byte(s)
==6693==    at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Syscall param mmap2(length) contains uninitialised byte(s)
==6693==    at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Syscall param mmap2(offset) contains uninitialised byte(s)
==6693==    at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4017F44: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x400BDD0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B5F4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B630: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BD7C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BD98: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401AA14: strdup (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B660: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B660: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B688: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4008E20: _dl_map_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Syscall param openat(filename) contains uninitialised byte(s)
==6693==    at 0x4019F4C: __open64_nocancel (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x40180E4: free (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x400BB84: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BB9C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BBBC: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BBC0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BBE0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BC50: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BC64: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BCA8: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BCC0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401AA30: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401AA48: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B628: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400BD9C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4005D98: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005DC4: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005DD0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005E50: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005E9C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005EA0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400602C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x40060C0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x40060DC: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4006114: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4006A0C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x40061D4: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4010FF4: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4011008: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401A620: strcmp (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4010FFC: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x4013660: _dl_get_origin (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B680: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B684: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B690: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B694: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6B0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6B4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4013674: _dl_get_origin (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x400832C: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x40082E4: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4008114: _dl_dst_substitute (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401A67C: strcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4008198: _dl_dst_substitute (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6A8: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6AC: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B6B4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x400926C: _dl_map_object (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B7A0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6AC: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B658: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B65C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B668: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B66C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B658: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B850: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6A0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6A4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B6A8: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005FE0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x4006020: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B648: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x401B900: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/libm-2.28.so:
--6693-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/libm-2.28.so:
--6693-- Last block truncated in .debug_info; ignoring
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B66C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== 
==6693== More than 100 errors detected.  Subsequent errors
==6693== will still be recorded, but in less detail than before.
==6693== Use of uninitialised value of size 4
==6693==    at 0x4005FCC: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/libc-2.28.so:
--6693-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6693-- WARNING: Serious error when reading debug info
--6693-- When reading debug info from /lib/arm-linux-gnueabihf/libc-2.28.so:
--6693-- Last block truncated in .debug_info; ignoring
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x400E3FC: _dl_map_object_deps (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Use of uninitialised value of size 4
==6693==    at 0x400E410: _dl_map_object_deps (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 
==6693== Conditional jump or move depends on uninitialised value(s)
==6693==    at 0x401B668: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==6693== 

mysql_free_result에 대해 발생해야 합니다.(sqlRes) && !(numRows)

언급URL : https://stackoverflow.com/questions/65604209/c-application-using-mysql-connector-c-libraries-consuming-memory-very-fast