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

High memory consumption due to ContextCache #1182

Open
2 tasks done
mohitnz opened this issue Oct 31, 2017 · 2 comments
Open
2 tasks done

High memory consumption due to ContextCache #1182

mohitnz opened this issue Oct 31, 2017 · 2 comments
Assignees
Labels
status:tracked Triaged and are being investigated further

Comments

@mohitnz
Copy link

mohitnz commented Oct 31, 2017

Reporting an Issue

High memory consumption due to ContextCache on running PnPPowershell commands for large number of items.

Expected behavior

Memory consumption should be low, or there should be a method to clear context cache.

Actual behavior

I am running PnP Powershell for SharePOint Online iterating over large number of items in a single library (more than 50,000 items ).

I have noticed that the the memory consumption for powershell increases till it consumes upto 4 GB.

On profiling the memory i discovered all the memory is consumed by ContextCache of SPOnlineConnection. (refer attached screenshot).
memory

Steps to reproduce behavior

The scripts are simple operations e.g.

for($i= 156765 ;$i -ne 1 ; $i--){
    Remove-PnPListItem -List  “Historical Note” -Identity $i -Force
    Write-host $i
}

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.16.1706.0

How did you install the PnP-PowerShell Cmdlets?

  • MSI Installed downloaded from GitHub
@erwinvanhunen
Copy link
Member

Hi!

I just checked here (with version 2.20.1711.0) and I am not able to reproduce this issue. The context cache never grows beyond one object in my case (as long as you are not switching context by specifying the -Web attribute it should never go beyond 1 object). Can you try to reproduce this with the latest build?

Thanks!

@VesaJuvonen VesaJuvonen added status:tracked Triaged and are being investigated further and removed Needs investigation labels Apr 26, 2019
@ComputerHabit
Copy link

When using the commands I can watch memory usage just keep ticking up. Until PowerShell crashes that is.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
status:tracked Triaged and are being investigated further
Projects
None yet
Development

No branches or pull requests

4 participants