Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ZLIB 1.2.1 - excessive page faults? Bug? Strange...!
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



Report this thread to moderator Post Follow-up to this message
Old Post
PokerAddict
09-15-04 01:55 PM


Re: ZLIB 1.2.1 - excessive page faults? Bug? Strange...!
"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

Report this thread to moderator Post Follow-up to this message
Old Post
Mark Adler
09-16-04 08:55 AM


Re: ZLIB 1.2.1 - excessive page faults? Bug? Strange...!
PokerAddict 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
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Dr Chaos
09-17-04 02:02 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:11 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.