473,473 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Memory Management Problem in device

sujithkrishnan
11 New Member
Im am getting error within try block when i try to deploy in device and run it.
However in emulator its working fine. In device the error is coming somtimes (when i execute that line second time... fourth time.. etc...)
Code is as follows...


MemoryStream ms = new MemoryStream();
Image image = new Bitmap(mainimage);

try
{
image.Save(ms, ImageFormat.Jpeg);

}
catch(Exception exObj1)
{
MessageBox.Show(exObj1.StackTrace,exObj1.Message);
}
ms.Close();
Mar 7 '08 #1
4 1619
markmcgookin
648 Recognized Expert Contributor
Im am getting error within try block when i try to deploy in device and run it.
However in emulator its working fine. In device the error is coming somtimes (when i execute that line second time... fourth time.. etc...)
Code is as follows...


MemoryStream ms = new MemoryStream();
Image image = new Bitmap(mainimage);

try
{
image.Save(ms, ImageFormat.Jpeg);

}
catch(Exception exObj1)
{
MessageBox.Show(exObj1.StackTrace,exObj1.Message);
}
ms.Close();
Can you post the call stack and the error message so we can have a bit more detail on the error pls!
Mar 7 '08 #2
sujithkrishnan
11 New Member
Its a "Memory Out of Bound Exception"....
Mar 10 '08 #3
sujithkrishnan
11 New Member
Its a "Memory Out of Bound Exception"....
Mar 13 '08 #4
markmcgookin
648 Recognized Expert Contributor
Its a "Memory Out of Bound Exception"....
Sounds like a problem in the input steam is flooding the memory, like the image size being too big (doubt it... unless you are trying to read in a huge image) or you aren't closing something somewhere?

Mark
Mar 13 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but...
12
by: ira2402 | last post by:
Hi All, We are developing sw for a small embedded OS and we have limited memory. We are looking for algorithms, links, and articles about this. The goal is efficient utilization of small amount...
9
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers,...
11
by: KalleD | last post by:
Hi, I need to use a lot of memory in an aplication. But I get OutOfMemoryException whenever I try to allocate more than around 1.2GB. Ex: byte c=new byte; My computer (win xp) have 4GB of RAM...
4
by: Brad Markisohn | last post by:
I want to be notified when a PnP device is added or removed. To accomplish this task, I added two occurrences of a System.Management.ManagementEventWatcher. I've included a snippet of code that...
13
by: Samshayam | last post by:
I have come across the application of placement new in memory mapped i/o in a number of books.I am not able to understand it completely, may be becaues of my lack of knowledge with memory mapped...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.