Notepad++ freezes on large files
-
From some point in the past Notepad++ started to freeze when working with large files. It freezes for some time, then works ok, then freezes again and so on. It seems the issue is related to navigation in file.
Here are callstacks of a thread that consumes some CPU time when app is freezed:
ntoskrnl.exe!KeSynchronizeExecution+0x5b66 ntoskrnl.exe!KeWaitForSingleObject+0x1460 ntoskrnl.exe!KeWaitForSingleObject+0x98f ntoskrnl.exe!KeWaitForSingleObject+0x233 ntoskrnl.exe!ExWaitForRundownProtectionRelease+0x7dd ntoskrnl.exe!KeWaitForSingleObject+0x3a29 ntoskrnl.exe!KeSynchronizeExecution+0x3140 gdi32full.dll!ScriptIsComplex+0x102 gdi32full.dll!LpkGetTextExtentExPoint+0xa6 gdi32full.dll!GetTextExtentExPointW+0x43 GDI32.dll!GetTextExtentExPointW+0x6f notepad++.exe+0xcbb7 notepad++.exe+0x7f34f notepad++.exe+0x8de99 notepad++.exe+0x30a15 notepad++.exe+0x30e27 notepad++.exe+0x2f128 notepad++.exe+0x37eef notepad++.exe+0x388c1 notepad++.exe+0x28384 notepad++.exe+0x41095 notepad++.exe+0x2aa2c notepad++.exe+0x6430 notepad++.exe+0x38ad6 notepad++.exe+0x5605 notepad++.exe+0x61e3 notepad++.exe+0x971d USER32.dll!CallWindowProcW+0x3f8 USER32.dll!CallWindowProcW+0x8e notepad++.exe+0x255cd0 notepad++.exe+0x25604f USER32.dll!CallWindowProcW+0x3f8 USER32.dll!DispatchMessageW+0x259 notepad++.exe+0x29149b notepad++.exe+0x2c2e56 KERNEL32.DLL!BaseThreadInitThunk+0x14 ntdll.dll!RtlUserThreadStart+0x21
ntoskrnl.exe!KeSynchronizeExecution+0x5b66 ntoskrnl.exe!KeWaitForSingleObject+0x1460 ntoskrnl.exe!KeWaitForSingleObject+0x98f ntoskrnl.exe!KeWaitForSingleObject+0x233 ntoskrnl.exe!ExWaitForRundownProtectionRelease+0x7dd ntoskrnl.exe!KeWaitForSingleObject+0x3a29 ntoskrnl.exe!KiCheckForKernelApcDelivery+0x2b ntoskrnl.exe!ExReleaseResourceAndLeaveCriticalRegion+0xc2 win32kbase.sys!GreReleaseSemaphoreInternal+0x10 win32kfull.sys!RFONTOBJ_vConstructPRFONTWrap+0x1e4 win32kfull.sys!NtGdiFlushUserBatch+0x344e win32kfull.sys!RFONTOBJ_dtorHelperWrap+0x365 win32kfull.sys!NtGdiGetTextExtentExW+0x20b win32k.sys!EngSaveFloatingPointState+0x796c ntoskrnl.exe!setjmpex+0x7c45 win32u.dll!NtGdiGetTextExtentExW+0x14 gdi32full.dll!LpkGetTextExtentExPoint+0xf2 gdi32full.dll!GetTextExtentExPointW+0x43 GDI32.dll!GetTextExtentExPointW+0x6f notepad++.exe+0xcbb7 notepad++.exe+0x7f34f notepad++.exe+0x8de99 notepad++.exe+0x30a15 notepad++.exe+0x30e27 notepad++.exe+0x3d203 notepad++.exe+0x40a0d notepad++.exe+0x2aa2c notepad++.exe+0x6430 notepad++.exe+0x14af9c notepad++.exe+0x18d53e notepad++.exe+0x195007 notepad++.exe+0x199778 notepad++.exe+0x26a268 USER32.dll!ScreenToClient+0xbc0 USER32.dll!ScreenToClient+0x362 USER32.dll!ScreenToClient+0x276 USER32.dll!CallWindowProcW+0x3f8 USER32.dll!DispatchMessageW+0x39c USER32.dll!SendMessageTimeoutW+0x143 ntdll.dll!KiUserCallbackDispatcher+0x24 win32u.dll!NtUserMessageCall+0x14 USER32.dll!SendMessageW+0x983 USER32.dll!SendMessageW+0xda USER32.dll!SetWindowsHookExAW+0x78cd notepad++.exe+0x1dd994 notepad++.exe+0x291462 notepad++.exe+0x2c2e56 KERNEL32.DLL!BaseThreadInitThunk+0x14 ntdll.dll!RtlUserThreadStart+0x21
-
@Igor ,
I’m not sure if there are any experts in thread callstacks in this Community discussion forum.
Normally my first guesses for any “freeze” would be: (1) a plugin or (2) the huge file is using a syntax highlighter. To check (1), run with
-noPlugin
command-line option; to check (2), switch Language menu selection to None (Normal Text)As always when asking for technical help in Notepad++, or trying to show a problem, giving the ?-menu’s Debug Info is a good idea. And giving more information about the file (actual size, rather than just saying “large”; file extension and what Language that Notepad++ auto-selects or that you manually selected; whether the file is on a HDD or SSD or on a network drive)
It should be noted that Notepad++ editor component hasn’t been optimized for huge files (on the order of hundreds of megabytes, and definitely not for gigabyte-and-larger files), because it tries to put the whole file into memory, and doesn’t do any memory-paging techniques. There are plugins like the BigFiles plugin (available through Plugins > Plugins Admin) that help with such things, but there are drawbacks to those plugin implementations.
But if you’ve found a true bug, you can read the FAQ about bug reports and follow the directions there to create a bug-report issue in the location it links you to.
-
the Language is set to None and
-noPlugin
doesn’t help.
The file size is for example 346 MB.Debug info:
Notepad++ v8.1.2 (64-bit) Build time : Jul 16 2021 - 01:59:50 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : -noPlugin Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Pro (64-bit) OS Version : 2009 OS Build : 19043.1110 Current ANSI codepage : 1251 Plugins : none
-
@Igor ,
346 MB
Yes, like I said, Notepad++ is not optimized for huge files.
It depends on the amount of memory you have (physical, free physical, and swap size). Also, it depends on the contents of the file. I generated a series of 500MB of random alphanumeric/space bytes, with no newlines, and 15 minutes after trying to load, still not done; even a 100MB with the same no-newlines wouldn’t load within 5min. On the other hand, when I generated a file that had 4Million 100-byte lines with newlines (so 400MB), it opens reliably in about 30sec.With the Big Files plugin, I was able to use the Plugins > Big Files > Open BigFile to open it (or its toolbar button), which breaks the file into chunks, and you can just edit a single chunk at a time. So if you don’t mind extra buttons to navigate through large chunks of your file, and edit those chunks piecemeal, then that’s probably the best idea for you to be able to stay inside Notepad++.
But Notepad++ is likely not going to be redesigned to make a truly seamless huge-file editor experience, because the editor component I.P. wasn’t designed for that, and it would require a complete rewrite of the application to use some other editor I.P. that handles huge files in a different manner; using a plugin like BigFiles is your best bet to stay within Notepad++.
-
@PeterJones said in Notepad++ freezes on large files:
It depends on the amount of memory you have (physical, free physical, and swap size)
There are 32 GB of RAM and 2 TB of NVMe drive. There is a lot of free space.
Also, it depends on the contents of the file.
It is a log file from an app. There are a lot of relatively shot lines of human readable text.
and 15 minutes after trying to load, still not done
It’s not about loading, even a huge file loads pretty fast. Then the app freezes during the work with the file - mainly, during cursor navigation. It freezes and unfreezes, freezes and unfreezes and so on. It seems like some heavy task is running from time to time in the UI thread.
-
This post is deleted! -
@Igor said in Notepad++ freezes on large files:
Then the app freezes during the work with the file - mainly, during cursor navigation. It freezes and unfreezes, freezes and unfreezes and so on. It seems like some heavy task is running from time to time in the UI thread.
Yes, it’s a huge file. Notepad++ has a lot of stuff it has to do while navigating around or editing a big file. Sorry.
As I said, the best option for you on this huge logfile seems to be Plugins > Big Files > Open BigFile, which will look at the file in chunks. If that doesn’t work for you, then there is no more advice I have for you with regard to Notepad++.