On Wed, 5 Jan 2011 11:08:18 +1100 Lex Trotman <[email protected]> wrote:
> 2011/1/5 Krzysztof Żelechowski <[email protected]>: > > Dnia wtorek, 4 stycznia 2011 o 20:19:55 Dimitar Zhekov napisał(a): > >> On Tue, 4 Jan 2011 19:43:23 +0100 > >> Krzysztof Żelechowski <[email protected]> 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. > > > And on modern kernels virtual memory can be overcommitted > significantly, so it may not work & is expensive since the page tables > have to be constructed even if the memory is not used. > > Also this could cause fragmentation of the virtual address space that > may limit how many times it will work. > > If you really want to do something then a warning "this is a big file > are you sure you want to open it" using a hidden pref is the most > sensible, with a pref value of zero meaning no check so people like me > with 4G can turn it off. I think this shouldn't be done as a hidden pref (in case of we really want to add such a thing which I doubt is very useful at all) as I'm sure a lot of people having issues with to big files and not reading this list will just not read manual etc. and therefor not be able to find the switch to either turn it on or off. Also the maximum is hardly depending on plattform and filetype ... at least from my experience open up huge XML files on Windows. I suggest to add a bool "Warn at huge files" im combination with an input element configuring at which point we are talking about a big file. Cheers + just my 2ct. Frank -- http://frank.uvena.de/en/
pgp3q3XJSpfWC.pgp
Description: PGP signature
_______________________________________________ Geany mailing list [email protected] http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
