Skip to content

Conversation

@AviAvni
Copy link
Contributor

@AviAvni AviAvni commented Mar 19, 2018

image
Talking with @dsyme I implemented Dump command to vs to help anlyze memory issues of F# language service in VS
The dump taken after all operations in Reactor finished
And I used ClrMD microsoft/clrmd#91 to take the dump so it not waste disk or ram
The dump written to the output window
@cartermp what do you think?
I'm also want to implement this on tests so we can compare memory after every build

One thing missing is thaat even that I added the Microsoft.Diagnostics.Runtime package to FSharp.Editor
and VisualFSharpFull projects the dll is not included in the vsix how I can fix this?

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving this "experience approval", in that I think this is a valuable tool and that it's worth having.

@Pilchie any thoughts on introducing another menu item here?

@majocha
Copy link
Contributor

majocha commented Mar 20, 2018

@AviAvni adding to VisualFSharpFull.csproj

  <ItemGroup>
      <VSIXSourceItem Include="$(OutputPath)Microsoft.Diagnostics.Runtime.dll" />
  </ItemGroup>

should probably work, but I have no idea if this is the recommended way to do it.

</Strings>
</Button>

<Button guid="FSharpProjectCmdSet" id="cmdidFsDump" priority="0x8000" type="Button">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addition should have (but obviously didn't) update all of the MenusAndCommands.vsct.*.xlf files. Can you try running this to force regeneration?

msbuild vsintegration\src\FSharp.ProjectSystem.FSharp\ProjectSystem.fsproj /t:UpxateXlf


<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="0.9.180305.1" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version number should be added to build\targets\PackageVersions.props under the other packages heading and placed in alphabetical order:

<MicrosoftDiagnosticsRuntimePackageVersion>0.9.180305.1</MicrosoftDiagnosticsRuntimePackageVersion>

And replaced in this file with $(MicrosoftDiagnosticsRuntimePackageVersion).

let projectSystemPackage =
lazy(
let shell = serviceProvider.GetService(typeof<SVsShell>) :?> IVsShell
let packageToBeLoadedGuid = ref (Guid "{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}") // FSharp ProjectSystem guid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the constant defined ProjectPrelude.fs as GuidList.guidFSharpProjectPkgString.

checkerProvider.Checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
use target = DataTarget.CreateSnapshotAndAttach(Process.GetCurrentProcess().Id)
let runtime = target.ClrVersions.[0].CreateRuntime();
let outputPane = projectSystemPackage.Value.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "FSharp Dump")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this API. Does "FSharp Dump" need to be localized/translated? If so it'll have to be added to a .resx file and consumed that way.

<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutablePackageVersion)" />
<PackageReference Include="VSSDK.VSLangProj" Version="$(VSSDKVSLangProjPackageVersion)" />
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="0.9.180305.1" />
Copy link
Member

@brettfo brettfo Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same build\targets\PackageVersions.props comment as above.

@Pilchie
Copy link
Member

Pilchie commented Mar 21, 2018

Sorry for the late reply - was on vacation. I would tend to prefer that this be added as an extension, perhaps into the "Project System Tools" extension? Tagging @panopticoncentral

@AviAvni
Copy link
Contributor Author

AviAvni commented Mar 21, 2018

@brettfo and @Pilchie thanks for feedback
This is in the "Project System Tools" because @dsyme wanted it in a specific state of the language service when all the work on the queue is done
In any case I'll be happy to continue work on this

@panopticoncentral
Copy link

This seems like it could be a good addition to the project system tools (https://github.com/dotnet/project-system-tools) and it fits with the general mission there. We've already added logging for the Roslyn language service. Take a look and let me know what you think, @AviAvni.

@AviAvni
Copy link
Contributor Author

AviAvni commented Mar 22, 2018

@panopticoncentral ok so how this is going to work?
can I use classes that declared in this repo there via nuget so I can take the dump when the lang service finished all operations
or I'll just do the dump there and it's need to be taken manually on time
or I'll expose it as a service and use that service here
or you have another idea?

@panopticoncentral
Copy link

Is the API to know when the lang service is done available publicly? If so, I'd just call it from the extension and then do the dump.

@KevinRansom
Copy link
Contributor

@AviAvni

Hello my friend, is this still an active work item for you?

Thanks
Kevin

@AviAvni
Copy link
Contributor Author

AviAvni commented Oct 2, 2018

I can work on it if you want but as said in comments it belong to other project that I don't know how to implement it there

@cartermp
Copy link
Contributor

cartermp commented Oct 2, 2018

Since @panopticoncentral is/will be on leave (I've been out myself and forgot the status!), @jmarolf would you be able to help @AviAvni with adding a Dump command to https://github.com/dotnet/project-system-tools ?

@KevinRansom
Copy link
Contributor

Thanks for this PR, however it looks to be quite out of date, please reopen, if you want to continue with it.

Kevin

@KevinRansom KevinRansom closed this Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants