[Geany] do not open oversize files
Frank Lanitz
frank at xxxxx
Tue Jan 4 10:05:47 UTC 2011
Hi,
Am 04.01.2011 10:31, schrieb Krzysztof Żelechowski:
> Dnia wtorek, 4 stycznia 2011 o 08:29:15 Lex Trotman napisał(a):
>> 2011/1/3 Krzysztof Żelechowski <giecrilj at stegny.2a.pl>:
>>> Geany should not try to open oversize files it is unable to digest.
>>>
>>> <URL: http://is.gd/jZn5B >
>>>
>>> The result is infinite thrashing and system unresponsive; the Process
>>> Monitor shows geany at 600MB swapped out.
>> How big is your file and how big is your memory?
> My file is 1.3 GB and my memory is 1 GB.
Wow.
>> Scintilla IIRC uses about 2*memory for buffering, so Geany needs that too.
>>
>> Unfortunately there is no way of knowing how much memory is available,
>> the requests for such information just return infinite (at least on my
>> system) so there is no way for Geany/Scintilla to limit the usage.
> One cannot inquire for available memory but one can inquire for Physical RAM. If file size is greater than 2 * RAM, ask the operator.
I think this will cause even more confusing than a slow running Geany on
a swapping system. Not every system does have a swap at all or at least
one which is twice as RAM-size. Also I could imagine not all system does
have a trust able syscall to figure out the physical memory.-
>>> (The less tool has no problem with displaying this file.)
>> Less does not buffer the file, it reads line by line and prints it,
>> but you can't do that with an editor.
> Of course, there is no editor that can edit any file.
> I suggest that Geany acknowledge that and do not try to edit a file it is uncapable of handling.
I don't see any valid algorithm to figure out whether Geany can do or
not. BTW: vim is able to do a more line based processing. At least a fan
of vim tried to told me some time ago. Of course,k I didn't believe him
as Geany and Emacs is much more cooler :D
Cheers,
Frank
More information about the Users
mailing list