内存管理.Net [英] Memory Management .Net

查看:116
本文介绍了内存管理.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我的.Net应用程序有问题。



这是一个场景,我有一个二进制文件,我导入的大小约为8mb,我将其转换为文本并过滤一堆字段,然后我创建一个约125kb的修剪版本,这很好。



好​​的问题,

当我转换这个文件时,它正在使用600mb的内存,因为我需要保存字符串中的字段,这是我的问题,但我不知道如何保存数据。当我完成它时,我已经尝试处理了所有的字符串,但是这没有任何效果。



我只是想知道是否有人可以解决这个问题。我的情况或如何更好地处理它。



问我是否不够清楚。



谢谢大家...

Hey I have a problem in my .Net application.

Here's the scenario, I have a binary file which I import which is about 8mb in size, I convert this to text and filter on a bunch of fields and then I create a trimmed down version of about 125kb which is fine.

Ok the problem,
When I am converting this file it is using 600mb of Memory because I need to hold the fields in strings which is where my issue is but I don't know how else to hold the data. I have tried disposing of all my strings when I am finished with them but this has no effect.

I'm just wondering can someone shed a bit of light on the situation for me or how to handle it better.

Ask me if I'm not being clear enough.

Thanks Guys...

推荐答案

可能是StringBuilder [ ^ ]类提供了你需要的东西。
May be the StringBuilder[^] class provides what you need.


这篇关于内存管理.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆