Skip to Content.
Sympa Menu

freetds - [freetds] Optimizing memory allocation when using dynamic SQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Optimizing memory allocation when using dynamic SQL
  • Date: Sat, 19 Jan 2008 12:13:08 +0100

Dear all,

Frediano Ziglio wrote:
http://msdn2.microsoft.com/en-us/library/ms709306(VS.85).aspx

Interesting, I knew about alignment issues, but from an optimization point of
view I have always asked myself if doing several malloc() of little pieces of
memory is really an issue...

We used to have our own mem allocation wrapper to optimize this in our VM but
we have removed it in latest version to just use malloc() as is... allocating
any size of memory...

I really wonder if C runtime library providers (on any platform) did not yet
optimize malloc() to allocate large blocks of memory (I mean, if you allocate
4 bytes, does it really just allocate 4 bytes or does it pick 4b in a memory
pool
or whatever and just increment an internal offset)?

This is a real issue for use, as we have different sort of database interfaces
and need to allocate buffers for dynamic SQL result sets...

Note also that such kind of memory optimizations is IMHO not significant if
you compare with database communication... am I wrong?

Any comment/advice is welcome!

Thanks a lot.

;-)
Seb




Archive powered by MHonArc 2.6.24.

Top of Page