i have a problem with UWP. I think there is a big memory leak problem in the views. The memory of the views it not released anymore. You can realize this on every navigation. The praid solution for the navigation problem is the navigation cache, ok, but i have a listview with a very complex itemtemplate. Every time an item is inserted in the listview, a new item template view is created, and never released anymore. i wrote a small example.MemoryLeakExample
Click on the button inserts 20 items. The app starts with 24MB of Memory. After 5 clicks we are at 100MB. Why?
Can anybody help me and tell me, what i'm doing wrong?
Greetings, Nico
If somebody is interested in this. The answer is: there is no answer.
I submitted a bug to Microsoft with this, and after three month of writing samples for Microsoft, show and explain them the bug, talking to Microsoft people and doing a lot of other time wasting stuff with them, they filed a bug on this and provided a sample to the product team.
So, the memory leak is real and my Code is not just a bad code.
Microsoft told me this week that they have fixed the bug! It was a handle leak. They put it into the windows inside preview build and the fix will be shipped with the spring update to windows.
So hopefully this is the real and last answer to this leak...
You could diagnose this with Memory Usage Tool in Visual Studio. For detail steps, you could refer Diagnosing memory issues with the new Memory Usage Tool in Visual Studio. And you could take snapshot in order to capture the state of the application memory. For more detail you could refer this case reply.
And I have also checked your code. I found you used Page as DataTemplate. And that is
no good idea. Because, you will create more page instance when added the item to list view. And UI virtualization will does not work. I verified it with Memory Usage Tool. Please check the following screen shot.
The count of TestBlockView increased by 11 and consume more memory.
And I have tried place all the TestBlockView xaml into the DataTemplate. No matter how many items I add, the memory will remain within reasonable limits.
For your requirement, you could make DataTemplate directly rather than using Page. And you could also use UserControl to replace Page.
Related
When I work on documents, I like to toggle to markdown preview frequently (old habit from MS Word days) or have the preview shown in a split window. What I've found is that the preview does not track the location that is in view in the editor, so I have to scroll down every time I check. If working in split window mode, the preview does not keep up and thus I have to keep scrolling that to catch up. This makes what should be an amazing workflow a bit of an irritation and it gets old very quickly.
I am considering switching editors because of it. But before I do that, I am hoping that perhaps someone out there knows of a way to pin the markdown preview to the current file location (locked scrolling, plugin, etc.) Thanks!
*** EDIT:
Ended up not switching, but found a plugin called Instant Markdown that launches a web preview of your document and renders it in real time. While it too does not track location through auto-scroll, it is much more pleasant to work with I have found, since I can move it around, even on another monitor and can thus keep much more of the render in view at once. This is a partial answer to the issue and I am no longer actively seeking the auto-scroll technique since I much prefer this technique for WYSIWYG.
Unfortunately, according to this issue #5047, the feature you are requesting is still under development
In case you didn't switch editors yet, this feature milestone is set to January 2017, i.e. we can hope that it will be done soon
My app for the iPad shows PDF-files by using a UIWebView. But sometimes when I click on several pdfs in a row, the first page of a pdf is blank suddenly. When I reopen the same pdf a second time, the first page is normal again. This happens from time to time and is not just linked to a specific pdf file.
Any ideas or did you had similar issues? Solutions? :/
Thanks in advance!!
Without seeing neither code, nor the PDFS, I would bet for a memory related issue, since you say this happens when showing several PDFs in a row. Indeed, UIWebView is highly optimized as to memory usage and keeps in memory only relevant parts of the page, so it could be that somehow your first page is unloaded.
You can check if this is the case by adding some NSLog traces to didReceiveMemoryWarning in your app delegate. If you see the trace logged just before the blank page issue appears, then this would be a hint that it might be a memory problem.
If my hypothesis is right, then a fix would be forcing the web page to refresh its content. Or you might try a workaround just to make this particular use case (quickly moving through multiple PDFs documents in a row) work. In both cases, I would need more detail to suggest any possible implementation.
The problem: In VS2010, I have a form with a broken design view. It's breaking on a couple of Atalasoft imageviewer controls.
The weirdness: Took me some time to figure this out, but if I go into the forms designer.vb file, and comment out everything regarding these controls, save, uncomment, and save again, the form design view loads perfect. NOTE: I'm not changing anything. Just commenting/uncommenting portions of the designer and saving.
The form design view continues to work fine until I do any of the following:
close the form design view and the designer.vb file and try to view again.
close the solution and reopen.
After doing either of these things, it's back to square one and I have to comment/uncomment/save to view the form designer again.
I'm on Win7, 64 bit. I have worked on this app in the past with no issue. The app builds and runs just fine. It's just a VS form design view issue, and I'm flummoxed.
I'd love to hear any thoughts on how I can solve this. If I can provide any more specific info, please let me know.
I've seen this happen rarely, when something odd gets into the designer file for a form and the designer can't figure out how to display things anymore. A third-party control being part of it could be indicative of some bug with that control's designer-related code.
One thing to try might be re-creating the form in question from scratch, and see if that fixes it. Perhaps something inadvertently got fubared. Also see if there is anything out there with others having designer problems with the same control(s) in question.
Sorry can't offer more direct help; maybe someone else has experienced something more closely related.
In Visual Studio, you can expand and collapse code without using regions, for example in a code-behind page you can collapse methods, etc... And in an ASPX page you can collapse tags, tags, etc...
It's useful when you have a long page and you want to focus your development on a specific part. What's cool about it too is that you can close the file and reopen it and the state of the expanded/collapsed blocks is saved exactly as you left it.
Except in one instance. That state is not saved for tags in ASPX pages, where it would be most useful.
I know there are some good plugins out there for VS but I couldn't find one that addresses this issue.
Has anybody got a solution?
Before you mention custom controls, they are not always convenient or feasible when trying to keep a page short and I don't consider this a solution to this problem.
Looks like this issue will stay unresolved at this time.
I opened a bug report on Microsoft Connect, if this issue is important to you please vote it up!
https://connect.microsoft.com/VisualStudio/feedback/details/613221/expanded-collapsed-state-not-saved-after-closing-file
I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is "Recent Projects"
Is there a way to customize it or replace with a better one?
It will be nice that the page contains Favorites Projects and Recent projects.
P.S. I know that I can disabled it or replace it with other web page, just looking for a good productivity tip.
Here's an article with a lot of detail on how to precisely customize the start page. Unfortunately, it looks to be a rather arduous process. But hey, if you have the time...
Customizing the Visual Studio .NET 2003 Start Page
Goto Tools > Options > Environment > Startup and pick the best option you like
One suggestion would be to follow the steps here:
http://blogs.msdn.com/saraford/archive/2008/01/03/did-you-know-how-to-customize-what-visual-studio-opens-to-or-how-to-make-the-start-page-not-show-up-when-vs-opens.aspx
You can also check out the useful information here. Aso for suggested things, check out this post.
The link posted by Kyralessa is a complete answer to your original question. Unfortunately, it does look like a complicated procedure.
I'll just add that if you're worried about any performance impact associated with fetching the RSS feed, you can enter a non-existent URL such as http://localhost:12345 that will fail quickly and reduce the amount of content needing to be rendered. In that way, you could keep the 'Recent projects' panel.
I too am not a fan of the startup page showing latest articles and news from MSDN.
I wouldn't mind glancing through a few articles, but the RSS feed is mega slow and the wait really slows down productivity, especially if I find myself opening and close it all the time.
Visual Studio will load much faster when the start page is disabled.
Here's how to do it:
Go to Tools => Options
Select the Startup child node under the Environment node.
Un-tick the auto loading of news articles
Clear the url box ...just to be sure ;)
Select "Show empty environment" from the combo box
Now, marvel at the dramatic speed boost to Visual studio 2008.