Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Full Solution Analysis smart toggling #4873

Closed
Therzok opened this issue May 22, 2018 · 6 comments
Closed

Full Solution Analysis smart toggling #4873

Therzok opened this issue May 22, 2018 · 6 comments

Comments

@Therzok
Copy link
Contributor

Therzok commented May 22, 2018

Consider adding a smart monitor in the IDE which toggles off full solution analysis in case we're using too much memory or so:
http://source.roslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/VirtualMemoryNotificationListener.cs,61

We should probably look into how vm_stat reports virtual memory and trigger it off automatically and notify the user: https://opensource.apple.com/source/system_cmds/system_cmds-541/vm_stat.tproj/vm_stat.c

VS bug #621143

@Therzok
Copy link
Contributor Author

Therzok commented May 23, 2018

So, we have the following options:

  1. use sysctl to get vm.vm_page_free_target (optimal value) and check if vm.page_free_count is lower.

  2. Set a OS dispatch

// void (*dispatch_function_t)(void *)

dispatch_function_t *myHandler; // get the data via dispatch_source_get_data
dispatch_source_t source = dispatch_source_create (
	DISPATCH_SOURCE_TYPE_MEMORYPRESSURE,
	0,
	DISPATCH_MEMORYPRESSURE_WARN | DISPATCH_MEMORYPRESSURE_CRITICAL | DISPATCH_MEMORYPRESSURE_NORMAL,
	dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
);
dispatch_source_set_event_handler (source, myHandler);
dispatch_resume (source);
// dispatch_suspend to temporarily disable a dispatch
// We also probably need retain/release semantics, but I think we'll hold the handler while the IDE is alive.
// And cancel when we want to take it off.
// If we hook anything else up (i.e. open resources), we also need to: dispatch_source_set_cancel_handler

And when we get to critical, we toggle off full solution analysis. Might be worth surfacing this as an IDE service. This could also help us monitor and flush whatever in-memory caches we have, to reduce memory footprint.

@Therzok Therzok self-assigned this May 23, 2018
@Therzok Therzok added this to the 15.8 milestone May 23, 2018
@mhutch
Copy link
Member

mhutch commented May 23, 2018

How useful is it to enable Full Solution Analysis, considering we don't surface yet analysis errors through the errors list?

@Therzok
Copy link
Contributor Author

Therzok commented May 23, 2018

@mhutch todo comments won't happen if full solution analysis is off, for example

@mhutch
Copy link
Member

mhutch commented May 23, 2018

Ah fair enough. Feels like we're doing a lot of work that won't be surfaced though.

@Therzok
Copy link
Contributor Author

Therzok commented May 23, 2018

At least, they will only show up for open files.

@xamarin-release-manager
Copy link
Contributor

[sync] [VS-15] Comment by xamarinc

Fixed in version 8.6.0.802 (master)

Author: therzok
Commit: da75ae9 (xamarin/monodevelop)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants