[Geany] do not open oversize files

Krzysztof Żelechowski giecrilj at xxxxx
Tue Jan 4 21:05:52 UTC 2011


Dnia wtorek, 4 stycznia 2011 o 20:19:55 Dimitar Zhekov napisał(a):
> On Tue, 4 Jan 2011 19:43:23 +0100
> Krzysztof Żelechowski <giecrilj at stegny.2a.pl> wrote:
> 
> > Dnia wtorek, 4 stycznia 2011 o 18:22:42 Dimitar Zhekov napisał(a):
> > > As a crude estimate, under Linux you can try to malloc(minimal
> > > presumable required memory). It won't be actually allocated, unless you
> > > memset() it or something, but if the result is NULL, a warning is
> > > justified.
> > > 
> > 
> > I do not know where you got it from, but the last OS I know that
> > behaved like that was MacOS 7. [cut]
> 
> Like what?..

Like necessarily allocating a contiguous block of physical memory.  GNU malloc uses mmap so it is all virtual.

> 
> > malloc fails at 01 << 040 at my place.
> 
> And so? On the machine I'm currently at: kernel 2.6.32, glibc-2.1,
> 512MB RAM + 512MB virtual, single malloc fails at ~640MB.
> 
> If by "01 << 040" you mean 4GB, how much real and virtual memory do
> you have?
> 
> 

I have 1 GB of physical memory.  (01 << 040) is the first integer that does not fit into unsigned int.

Chris



More information about the Users mailing list