[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

C++, mysql & hukommelse



Hej sslug

I C++ opretter jeg en monster mysql-tabel med 172 kolonner, og fylder
ca. 20000 rækker i den.

Først samler jeg data til tabellen. De bliver fyldt i  hash maps.
Under denne proces bruges ca 17% af hukommelsen (af 512 mb).

Problemet kommer når jeg begynder at fylde tabellen.
Medens løkken der fylder tabellen, kører, ædes der bravt af
hukommelsen. Den når op på ca. 40%.
(Jeg ville gerne have at mit program skulle holde sig på under ca. 100mb,
altså 20% af min hukommelse)

Hvordan kan det egentlig være at der bruges hukommelse under en:

   while ((row=mysql_fetch_row(result)))   // (nøgle hentet fra anden tabel)
      {mysql_query(mysql_handle,"INSERT INTO  table <snip>");
      }

Er det fordi mysql ikke kan nå at skrive rækkerne så hurtigt som de bliver
præsenteret og så lagres de i en hukommelses buffer ?

Hvis det er nødvendigt med mere kode for at svare, skal jeg nok poste noget,
selv om det er lidt uoverskueligt med alle de variable jeg har.

På forhånd mange tak


Med venlig hilsen  Jan Kirk Christensen


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *