Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak when creating msgraph client #436

Closed
erictg opened this issue Mar 13, 2023 · 6 comments
Closed

Memory Leak when creating msgraph client #436

erictg opened this issue Mar 13, 2023 · 6 comments
Labels
question Further information is requested Status no recent activity

Comments

@erictg
Copy link

erictg commented Mar 13, 2023

Explanation

When starting a basic test program for msgraph, go program fails to start with msgraph imported. When monitoring HTOP while the program is running, massive amounts of memory are used up. I have no idea why this is happening, as this is just a rest package. It shouldn't be doing anything that memory intensive.

Steps to reproduce

Run the following.
Note the code does not fail with msgraph commented out and azidentity running. It always fails with msgraph.

package main

import (
	"fmt"
        "log"
	msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
)

func main() {
	log.Println("trying to get creds...")
	// get credentials
	// cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, clientSecret, nil)
	// if err != nil {
	// 	log.Fatal(err)
	// }

	// log.Println(cred)

	log.Println("created credential")

	client, err := msgraphsdk.NewGraphServiceClientWithCredentials(nil, []string{})
	if err != nil {
		log.Fatal(err)
	}
}

Relevant version numbers:

(note I am intentionally using older versions in order to use azidentity 1.3.0-beta.1 for az workload identity. This specific case is not using workload identity, but exists in the same code base)

  • github.com/microsoftgraph/msgraph-sdk-go v0.57.0
  • github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
  • github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0-beta.1
  • github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0
  • github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
  • github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0

Impact

This is completely blocking my progress in development. I may end up writing custom rest calls to msgraph in the meantime because this is unusable

Related Issues

@ghost ghost added the Needs Triage 🔍 label Mar 13, 2023
@baywet baywet added question Further information is requested Needs Attention 👋 and removed Needs Triage 🔍 labels Mar 13, 2023
@rkodev
Copy link
Contributor

rkodev commented Apr 11, 2023

Hi @erictg, The current issue is not a result of a memory leak but is because of the size of the SDK. While we are working continuously on improving the sdk perfomance, this is an issue that was reported and worked on here.

It would be helpful to share the details of the device running the package i.e RAM and CPU.

One of the options currently is using the kiota for a self serve style SDK where you get to choose only the packages that you want for the SDK. Please keep updating to the latest weekly release as performance improvements are an ongoing task.

@erictg
Copy link
Author

erictg commented Apr 11, 2023

My computer has 16Gb of ram and an i7 processor running fedora 37 and Go 1.19

I don't understand why the SDK would consume 16Gb of ram, that really doesn't seem right even with a large SDK.

@rkodev
Copy link
Contributor

rkodev commented Apr 12, 2023

Hi @erictg, What disk drive are you using HDD/SSD, could you please share the filesystem usage while running the build.

@erictg
Copy link
Author

erictg commented Apr 12, 2023

@rkodev I am using an SSD and the file system is btrfs

@andrueastman
Copy link
Member

@erictg Any chance you can confirm if this is still an issue for you on the latest sdk version?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Status no recent activity
Projects
None yet
Development

No branches or pull requests

4 participants