Exchange Online V2 module memory management issues

Animesh Anand 81 Reputation points

We are trying to migrate to Exchange Online V2 module(EXO V2) from EXO V1. However, when we connect using the Connect-ExchangeOnline cmdlet, we observe the memory utilization goes to around ~200MB for the process.

We do this from C# code. However, doing the same from powershell.exe also gives us similar observation.

Post connect, we call the Disconnect-ExchangeOnline. We were under the impression calling the Disconnect-ExchangeOnline cmdlet should release the resources\memory. However. we don't see this happening. The memory utilization does not change.

Same connection establishing in V1 does not consume so much memory. For our solution we need to make continuous calls to O365 for different tenants. Our observation has been over a period of time this memory utilization keeps adding up and we end up running out of memory.

We tried to dispose the runspace, abort the thread etc. But unless the process is killed, the memory is not reclaimed.

We needed some pointers for this memory utilization. How can be make the EXO V2 connect call release the memory it has reserved?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,174 questions
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,206 Reputation points

    @Animesh Anand

    If you have questions or suggestions about Exchange online PowerShell V2 module, you can post it in GitHub. As far as I know, there are engineers who deal with issues related to PowerShell V2 modules.

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful