Re: Pixbuf loading question



On Mon, 2008-04-07 at 15:50 +0200, nico wrote:
> Paul Davis a écrit :
> >
> >
> > it is the operating system that does this for you, not GTK.
> >   
> wow my operating system is so clever ;-)
> > the only way i know that you can stop this is to run something before
> > your application that starts up which will completely clear what is
> > called the "buffer cache". there are a number of ways of doing this. one
> > can be to run a grep across the whole filesystem. 
> If I understand correct a command like :
> "grep -R dummy /" ?

assuming you've got more stuff on disk than you have memory, that should
work, most of the time.

> 
> > another is a small
> > program that allocates more and more memory until it fails.
> >   
> Do you have an example for that ? Like always creating a big object in
> a  for ever loop ?

pretty much. something like:

#include <stdlib.h>

int
main () 
{
	size_t sz = 10 * 1024 * 1024;

	while (1) {
	    if (malloc (sz) == 0) {
	        break;
	    }
        }
	return 0;
}		


should do it. depending on how much memory you have, it can take a while
(several seconds).





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]