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

Images do not show updated when changed on disk #7951

Closed
eByte23 opened this issue Jun 22, 2016 · 12 comments
Closed

Images do not show updated when changed on disk #7951

eByte23 opened this issue Jun 22, 2016 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@eByte23
Copy link

eByte23 commented Jun 22, 2016

New description @bpasero
Depends on electron/electron#6275

Old

  • VSCode Version: 1.2.1-1.3.0 latest
  • OS Version: windows(test) most likely all

1- Steps to Reproduce:

  1. Open a folder with 5 or so large images in vscode
  2. click between them quickly
  3. vscode crashes

2- Steps to Reproduce:

  1. Open a project in vscode
  2. Enable tabs
  3. Open some large files quickly and switch between them
@eByte23
Copy link
Author

eByte23 commented Jun 22, 2016

Will add further details later e.g. memory usage, dumps etc.. /cc @bpasero (If you want to track)

@bpasero
Copy link
Member

bpasero commented Jun 22, 2016

@eByte23 how large are those images? can you attach the files you use?

@bpasero bpasero added info-needed Issue requires more information from poster freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues labels Jun 22, 2016
@bpasero bpasero added this to the Backlog milestone Jun 22, 2016
@bpasero bpasero self-assigned this Jun 22, 2016
@eByte23
Copy link
Author

eByte23 commented Jun 22, 2016

@bpasero I can't provide the images as the are client images probably copyrighted also.

But here are the sizes and types
image

@bpasero
Copy link
Member

bpasero commented Jun 22, 2016

Thanks. And the files you open are all of the same file type and similar size?

@eByte23
Copy link
Author

eByte23 commented Jun 22, 2016

Just varying of all those types, it was happening switch between the biggest file in the list to others very quickly

@bpasero bpasero modified the milestones: June 2016, Backlog Jun 22, 2016
@bpasero bpasero added the important Issue identified as high-priority label Jun 22, 2016
@bpasero bpasero changed the title Crashing every few minutes with tabs and reliably with large images @eByte23 memory leak opening images in Code Jun 28, 2016
@bpasero
Copy link
Member

bpasero commented Jun 28, 2016

There are multiple issues:

  • opening a large image adds quite some memory to the process
  • closing the editor with that image does not release this memory for whatever reason
  • we add a random number to the image path so that upon opening we bypass the browser cache and thus we add this memory each time you activate a tab

I do not have good solutions. If we disable the random number, we easily hit an issue where users would see stale images if they change meanwhile which can be frustrating.

The more interesting question is: Can we teach Chrome somehow to release the image resources? I have filed electron/electron#6275 against Electron to find out.

@bpasero bpasero assigned bpasero and unassigned bpasero Jun 28, 2016
@bpasero bpasero added feature-request Request for new features or functionality and removed important Issue identified as high-priority info-needed Issue requires more information from poster labels Jun 29, 2016
@bpasero bpasero modified the milestones: July 2016, June 2016 Jun 29, 2016
@bpasero
Copy link
Member

bpasero commented Jun 29, 2016

Since this has been like that since day one, and my proposed solution using a webview is rather large, I am moving this to July to investigate further.

@bpasero bpasero changed the title @eByte23 memory leak opening images in Code Show image preview in a webview to avoid memory leaks Jul 1, 2016
@bpasero bpasero modified the milestones: Backlog, July 2016 Jul 7, 2016
@bpasero
Copy link
Member

bpasero commented Jul 7, 2016

I pushed a workaround for now to not add a random number to the image URL when showing the image. This has the benefit of keeping the memory pressure low because we avoid loading the same image over and over. It has the downside that the image will not show any changes if it has been updated. I plan to add an explicit refresh action to the image viewer so that you can still force it to repaint.

@bpasero bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 7, 2016
@bpasero
Copy link
Member

bpasero commented Jul 7, 2016

Marking as upstream due to electron/electron#6275

@bpasero bpasero removed freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues feature-request Request for new features or functionality labels Jul 15, 2016
@bpasero bpasero changed the title Show image preview in a webview to avoid memory leaks Restore dynamic image URL to show images always up to date Jul 15, 2016
@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Aug 17, 2016
@jaime-olivares
Copy link

In gulp there is a watch functionality for sensing changes in the source code for a given folder/glob (usually for recompiling). Can we use the same technique for updating the cached images?

@bpasero bpasero modified the milestones: September 2016, Backlog Sep 3, 2016
@bpasero bpasero removed the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Sep 3, 2016
@bpasero bpasero changed the title Restore dynamic image URL to show images always up to date Images do not show updated when changed on disk Sep 3, 2016
@bpasero bpasero closed this as completed in 4f21084 Sep 5, 2016
@bpasero
Copy link
Member

bpasero commented Sep 5, 2016

Verify: images changed outside are reloading in VS Code (both for when the image is active in a tab as well as if inactive and you make it active).

@demus
Copy link

demus commented Oct 9, 2016

this is still happening to me

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants