Code Comments
Programming Forum and web based access to our favorite programming groups.Hi there
See the following small test program:
-------------------
unsigned char src[10000];
unsigned char dst[10500];
unsigned long dstlen = 10500;
while (1)
{
long r = compress2( (unsigned char*)dst, // dst
&dstlen, // compressed len
src, // memory to compress
8192, // src len
9); // compression level
Sleep(2);
}
------------------
I use WindowsXP. The compiler is MetroWerks CodeWarrior 9.2
I get a large number of page faults in my program.
TaskManager says 20.000/s. This is a problem, since
we are creating a large application with 10.000 connections
at the same time, and use the zlib to compress the traffic.
But with so many page faults the program runs slow.
I have no idea whats going on, even trying to looks around
alot in your code.
Why would the compressor generate page faults...???
sincerely
Søren
Post Follow-up to this message"PokerAddict" <sodan@NOSPAMsodan.dk> wrote in message news: > Why would the compressor generate page faults...??? There is apparently very little real memory available to that task. zlib uses on the order of 256K bytes as a hash table, with essentially shotgun reads and writes. So somehow your task is getting less than 256K of real memory (on a modern machine with a few orders of magnitude more memory?). mark
Post Follow-up to this messagePokerAddict wrote:
> Hi there
>
> See the following small test program:
>
> -------------------
> unsigned char src[10000];
> unsigned char dst[10500];
> unsigned long dstlen = 10500;
> while (1)
> {
> long r = compress2( (unsigned char*)dst, // dst
> &dstlen, // compressed len
> src, // memory to compress
> 8192, // src len
> 9); // compression level
> Sleep(2);
> }
> ------------------
>
> I use WindowsXP. The compiler is MetroWerks CodeWarrior 9.2
>
> I get a large number of page faults in my program.
> TaskManager says 20.000/s. This is a problem, since
> we are creating a large application with 10.000 connections
> at the same time, and use the zlib to compress the traffic.
> But with so many page faults the program runs slow.
>
> I have no idea whats going on, even trying to looks around
> alot in your code.
>
> Why would the compressor generate page faults...???
it may have nothing to do with this. Might it be
a dynamic linking problem? Can you link in the compressor
library statically?
>
> sincerely
> Søren
>
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.