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

MemoryLeak: MemoryStream not freed up after uploading #28

Open
fengyuan213 opened this issue Jun 29, 2022 · 1 comment
Open

MemoryLeak: MemoryStream not freed up after uploading #28

fengyuan213 opened this issue Jun 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@fengyuan213
Copy link

fengyuan213 commented Jun 29, 2022

Hi Dev,
Recently I am using .net 5 to make an upload queue using Qcloud, When finished proceeding with uploading, the memory stream associated with it has not been properly released which takes a quite a large amount of memory.
Memory Snapshot
image

Code to upload for a single file

void Wait(){
            CurrentUploadingTask.Wait();
}
void Start(){
         // 初始化 TransferConfig
            var transferConfig = new TransferConfig();
            // 初始化 TransferManager
            var transferManager = new TransferManager(CosXml, transferConfig);
            
            // 存储桶名称,此处填入格式必须为 bucketname-APPID, 其中 APPID 获取参考 https://console.cloud.tencent.com/developer

            var bucket = TencentBucketAppId;
            var cosPath = UploadPackage.ResourceKey; //对象在存储桶中的位置标识符,即称对象键
            var srcPath = UploadPackage.FileLocalPath; //本地文件绝对路径

            // 上传对象
            var uploadTask = new COSXMLUploadTask(bucket, cosPath);

            uploadTask.SetSrcPath(srcPath);
            uploadTask.failCallback = FailCallback;
            uploadTask.successCallback = UploadSucceedCallBack;
            uploadTask.progressCallback = UploadProgressCallBack;
            
            CosXmlUploadTask = uploadTask;
            CurrentUploadingTask = transferManager.UploadAsync(uploadTask);
       
}
@fengyuan213 fengyuan213 changed the title BUG: Potential Memory Leak MemoryStream not freed up after uploading Jun 29, 2022
@fengyuan213 fengyuan213 changed the title MemoryStream not freed up after uploading MemoryLeak: MemoryStream not freed up after uploading Jun 29, 2022
@learningZhang learningZhang added the bug Something isn't working label Jan 22, 2024
@learningZhang
Copy link
Contributor

还在规划中,暂无时间节点,上线后pub中会有说明

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants