List:General Discussion« Previous MessageNext Message »
From:Diego Zabaleta Date:November 21 2000 2:02pm
Subject:RE: Memory problem.
View as plain text  
What I could observe is that the demons mysqld are consuming memory in
incremental form (to see this I use the tool ' top' of RedHat Linux 6.2),
each certain time consumes 4kb but, after the program finishes these demons
they liberate the memory (top informs me that the demons mysqld are
consuming less memory than before);  to the I finish of one day they end up
consuming but of 10 mbytes by heart (this depends on the quantity from calls
to a routine that he/she obtains data of a chart).

I use an only active connection, which closes at the end of the program; on
this connection I carry out thousands of calls to obtain data, after
obtaining every Sep of data I call to the routine ' mysql_free_result'. I
think that each called n is increased the use by heart of mysqld. I have
proven to make the calls every 10 seconds and mysqld it consumes enough but
quick memory that making them each 2 or 3 minutes.

Thank you,
Diego. -


-----Mensaje original-----
De: Sinisa Milivojevic [mailto:sinisa@stripped]
Enviado el: Sábado 18 de Noviembre de 2000 10:03 AM
Para: dzabalet@stripped
Cc: mysql@stripped
Asunto: RE: Memory problem.


Diego Zabaleta writes:
 >
 > I believe that I am having some problem with the API of C.
 > That you find the following test:
 >
 > I implement a program in C that the only thing that makes is to call a
 > routine that obtains data of a chart every so often MySQL (ej: 10
seconds),
 > continuing the it lines of the function that happens to you previously.
 > The connection will liberate it when the program concludes.
 > I will make that the program calls to the routine during a followed day,
at
 > the same time I examine the use by heart.
 > Supposing that the routine in C that obtains the data of MySQL this well
 > implemented one, the memory should be liberated after having completed
each
 > call. Correct?
 >
 > The function that I will use serious the following one:
 >
 >  int DB_Existe_Id_Cliente (element *agente)
 >  MYSQL_RES  *result;
 >  int 		retorno;
 >  MYSQL_ROW  row;
 >
 > sprintf(query, SELECT yams FROM clients WHERE
 > id=%d",agent->info.header.id_cliente);
 > if ((retorno=mysql_query(connection,query)) != 0)
 >          return -1;
 >  result=mysql_store_result(connection);
 >
 >  if (mysql_num_rows(result) == 0)
 >
 >
 >         mysql_free_result(result);
 >         return FALSE;
 >  }
 >
 >   IF ((row=MYSQL_FETCH_ROW(result)) == NULL)
 >                   return -3;
 >
 >   strcpy(agente->info.header.nombre_cliente,row[0]);
 >   mysql_free_result(result);
 >   return TRUE;
 > }
 >
 > Thanks.
 > Diego.-
 >


Hi!

Will you please explain how do you conclude that memory is not
released ??

You know that at the end of your program you have to call mysql_close
??

I would simply like to see how do you diagnose that memory is not
released ??


Regards,

Sinisa

      ____  __     _____   _____  ___     ==  MySQL AB
     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic
    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus
  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____
  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
             /*/             \*\                Developers Team

--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php" before
posting. To request this thread, e-mail mysql-thread56718@stripped

To unsubscribe, send a message to:
    <mysql-unsubscribe-register.salop=ic24.net@stripped>

If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
    http://lists.mysql.com/php/unsubscribe.php

Thread
Memory problem.Diego Zabaleta17 Nov
  • Re: Memory problem.Sinisa Milivojevic17 Nov
RE: Memory problem.Diego Zabaleta17 Nov
  • RE: Memory problem.Sinisa Milivojevic17 Nov
RE: Memory problem.Diego Zabaleta17 Nov
  • RE: Memory problem.Sinisa Milivojevic18 Nov
RE: Memory problem.Diego Zabaleta21 Nov
  • RE: Memory problem.Sinisa Milivojevic22 Nov