当内存不足时我们如何解决 [英] How we can solve when there is out of memory

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

问题描述

using (Image image = Image.FromFile(imagePath))// problem line
                {
                    byte[,] grayValues = image.GetGrayScaleValues();
                    var tuple = new Tuple<string,>(imagePath, grayValues);
                    imagePathsAndGrayValues.Add(tuple);

推荐答案

从这些代码行中,我只有一个建议:获取更多内存或使用较小的图像文件。但是,在进入此行之前,您可能会耗尽太多内存;那么这是我从你的帖子中看不到的东西。



-SA
From these lines of code, I have only one advice: get more memory or use smaller image files. However, you could use up too much memory before getting to this line; then this is something I cannot see from your post.

—SA


这篇关于当内存不足时我们如何解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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