Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode does not open large files #9832

Closed
d180cf opened this issue Jul 27, 2016 · 15 comments
Closed

vscode does not open large files #9832

d180cf opened this issue Jul 27, 2016 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@d180cf
Copy link

d180cf commented Jul 27, 2016

Basically, I tried to open a 250 MB log file and got a message that vscode doesn't support this. vs2015 opened the file in a second.

I like that it didn't hang or crash, like many other editors, but I don't see why opening large log files is a hard problem. Log files generally have a simple structure: a sequence of reasonably long text lines; vscode could detect if the file looks like a good log file and render a part of it that is visible. Obviously, then I'll want all the cool features like regexp search and highlighting, but I believe that this can be nicely abstracted at the fs level.

@egamma
Copy link
Member

egamma commented Jul 27, 2016

@alexandrudima @gregvanl I suggest that we document our approach to large file handling in the FAQ.

@alexdima alexdima added the feature-request Request for new features or functionality label Aug 2, 2016
@alexdima
Copy link
Member

alexdima commented Aug 2, 2016

@d180cf VSCode is optimized for editing. There are a great deal of assumptions one can make when creating a log viewer:

  • the user is not allowed to edit the file
  • since no changes can be made by the user to the file through the editor, the editor does not need to guarantee that no changes are lost
  • this means that the file does not need to be kept in memory for the one in a million chance that it gets written/deleted by accident on disk and valuable changes made by the user get lost
  • log files usually do not contain programming languages, so in all likelihood each log line can be colored independently of the rest of the file. This is not the case for programming languages, where a /* at line 1 might impact the coloring of line 2 million.

These assumptions (read-only, context-independent line coloring) are not assumptions we can make in VSCode since our primary scope is to be an editor for programming languages and not a log viewer.

This does not mean we could not be also a good log viewer, it is just not a top priority. Other than that, the only thing stopping us from opening that file is basically getting an OOM exception.

@alexdima alexdima added this to the Backlog milestone Aug 2, 2016
@regs01
Copy link

regs01 commented Aug 24, 2016

There could be some large files that needs to be edited, like SQL files, resource files or JSON files. NotePad++ and AkelPad handles them well.

@suns-echoes
Copy link

Hello. I'm working a lot with books and dictionaries in text format (html, xml, sql, others). I do parsing, conversion and editing. VS Code works stable and smooth with files around 10MB, great job MS! How ever from time to time I have to work also with dictionaries with size of 100+MB and cannot do my job in VS Code. It would be awesome to have possibility to do work using one app instead of switching between different apps while working on the same project.

Notice: Notepad++ tend to corrupt files with size above few MB !!!

@gouletr
Copy link

gouletr commented Oct 21, 2016

I agree it would be very useful for VSCode to be able to open large files.

Example: I wrote an app in C++ and compile it with Emscripten, which can produce pretty big .js files, depending on code size. Using the VSCode Chrome Debugger extension, we can debug Emscripten applications if they were built with proper build flags (source maps not absolutely necessary).

However, if the .js file is several MB, past a certain point VSCode will refuse to open them, so we can't put breakpoints anymore and use VSCode to debug. Interestingly, if you are a tiny bit below the VSCode max file size, it works like a charm.

Since there's no good options right now to debug Emscripten apps, it would be great if that limit was a user setting (or just removed) so that we can use VSCode in that scenario.

@BillDenton
Copy link

I regularly need to inspect large log files. Whilst looking at them I often refer to the source files (C) to help in understanding them. So large file support is important.

@danechitoaie
Copy link

I'm very happy that VSC doesn't crash when opening a large file like the other editors but I would be even happier if it would be possible to still allow the file to be opened in a "stream mode". Basically you can disable the syntax highlight (and maybe other features that would be resource intensive to implement on large files) but open and read the file in chunks of data (what's needed to be displayed on screen) and load more as you scroll (up or down).

@josemigallas
Copy link

Any updates on this? IMO it's very annoying to have to change the editor or use the terminal whenever I need to check some log.

@jankap
Copy link

jankap commented Feb 14, 2017

A stream mode or a tail/less like experience would be awesome. Any news on that?

@danechitoaie
Copy link

Yes, no need to load all file in memory. And also having syntax highlight disabled is ok. Just being able to open it and "stream trough it" would be perfect.

@alexdima
Copy link
Member

alexdima commented Jul 7, 2017

Improvements have been made in #30180 , and our memory usage is now roughly:

file size on disk + 40-60 bytes (2 objects) per line + an array of pointers of length line count

We will look into removing or raising the limit on 64 bit platforms

@baslr
Copy link

baslr commented Jul 14, 2017

I cant open a file with 60.2 MB and 1.1m lines.
Is there a hidden setting to overwrite the limitation?

@evandrocoan
Copy link

Possible duplicate of:

  1. VS Code fails to open big files (60MB) #6474 VS Code fails to open big files (60MB)

@alexdima
Copy link
Member

With the upcoming 1.15, the file size limit has been lifted on the 64bit releases of VSCode. On the 32bit variants, the file size limit has been raised to 300MB.

Files over 20MB or with more than 300k lines will be treated especially, and some of the features will be turned off for them (e.g. tokenization, word wrapping, etc.) in order to save memory.

@alexdima alexdima modified the milestones: July 2017, Backlog Aug 10, 2017
@micahsnyder
Copy link

On a related topic, I am unable to diff two files when one of them is very large. Currently using a 64bit version of VS Code on MacOS.

My command line is along the lines of:
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --diff

The files open in a side-by-side locked scrolling method, but I receive a warning notification "Cannot compare files because one file is too large."

No diff is performed. In my case, one file is 8.4M and the other is 30M.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests