|
Hello,
I wrote window application that has some datagrids and data from SQL. I saw in task manager that this application uses 23 MB memory. Is it considered as normal / high ? And if high how can i reduce it?
BTW it's only the beginning of the application writing. I will have to add much more datagrids and other stuff...
|
|
|
|
|
23MB is nothing to concern yourself with at all. It sounds quite modest to me, even for a small application.
Regards,
Rob Philpott.
|
|
|
|
|
.net memory management is different to non.net apps
See previous post and replies here[^] and here[^].
Simon
|
|
|
|
|
OK thanks.
But i am going to add much more datagrids to this application?
Does using with methods and classes reduces the memory usage or not?
I am nor worried now, but still there will be much more datagrids and stuff (about 10 times more datagrids)
|
|
|
|
|
michaelgr1 wrote: But i am going to add much more datagrids to this application?
It will be almost certainly be OK.
michaelgr1 wrote: Does using with methods and classes reduces the memory usage or not?
No, memory is not reduced, but it is good practise (because it improves maintainability) to divide your code up into clean logical blocks of classes the perform a single function and simple methods.
My advice is don't worry. If you reach a point in the future where your application starts to perform badly you can profile it then and reduce the bottle neck. It's almost impossible to predict in advance exactly where a bottle neck will occur, so don't waste time now trying to solve problems that you don't have yet. Besides, for data driven apps, the real bottle neck is almost certainly going to be related to loading the data from the database and nothing to do with memory usage on the client side.
Simon
|
|
|
|
|
Hi.
Does anyone know if it is possible to do a "search and replace" in the regex expression, without using the
RegEx.Replace method?
Alternatively: Does it exist a perl regex-library to be included i C#
Kjetil
|
|
|
|
|
Hi
I would like an application to automatically check for updates from a location on a company's internal network. Something like L:\Comapany Files\Application\
I do not have direct access to this network on my development machine. I'll just dump the new version in this folder manually.
(Running VS 2008)
Thanks
|
|
|
|
|
Click once deployment is the simplest way to go.
If click once isn't an option you'll have to code the updater manually. It will have to check the known location, compare the versions, download the update, stop itself and restart the new version. This is often done via a secondary "update app" because otherwise you'll have trouble copying the new binaries over the old ones while the app is still running.
Simon
|
|
|
|
|
Use FileSystemWatcher class
MS describes this as:
Use FileSystemWatcher to watch for changes in a specified directory. You can watch for changes in files and subdirectories of the specified directory. You can create a component to watch files on a local computer, a network drive, or a remote computer.
To watch for changes in all files, set the Filter property to an empty string ("") or use wildcards ("*.*"). To watch a specific file, set the Filter property to the file name. For example, to watch for changes in the file MyDoc.txt, set the Filter property to "MyDoc.txt". You can also watch for changes in a certain type of file. For example, to watch for changes in text files, set the Filter property to "*.txt".
There are several types of changes you can watch for in a directory or file. For example, you can watch for changes in Attributes, the LastWrite date and time, or the Size of files or directories. This is done by setting the NotifyFilter property to one of the NotifyFilters values. For more information on the type of changes you can watch, see NotifyFilters.
You can watch for renaming, deletion, or creation of files or directories. For example, to watch for renaming of text files, set the Filter property to "*.txt" and call the WaitForChanged method with a Renamed specified for its parameter.
The Windows operating system notifies your component of file changes in a buffer created by the FileSystemWatcher. If there are many changes in a short time, the buffer can overflow. This causes the component to lose track of changes in the directory, and it will only provide blanket notification. Increasing the size of the buffer with the InternalBufferSize property is expensive, as it comes from non-paged memory that cannot be swapped out to disk, so keep the buffer as small yet large enough to not miss any file change events. To avoid a buffer overflow, use the NotifyFilter and IncludeSubdirectories properties so you can filter out unwanted change notifications.
For a list of initial property values for an instance of FileSystemWatcher, see the FileSystemWatcher constructor.
Please note the following when using the FileSystemWatcher class.
Hidden files are not ignored.
In some systems, FileSystemWatcher reports changes to files using the short 8.3 file name format. For example, a change to "LongFileName.LongExtension" could be reported as "LongFi~.Lon".
This class contains a link demand and an inheritance demand at the class level that applies to all members. A SecurityException is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see Link Demands.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Everyone,
I see that Rebbon Control in Microsoft office 2007 is beautiful.
Do you know where can i download a full and free (rebbon control)?
Then i can develop with c sharp.
Thanks,
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
If you change the spelling to ribbon and search here there's one in the articles.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks for your comment.
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
|
Thanks so much brothers!
Notice : Where can i rate the article?
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
|
Thanks so much for the answer.
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
|
How to deal with "OutOfMemoryExceptoin" in my C# code based on WinCE5.0 in Arm9
I Load many images in order to make my Project looks well and .exe file in debug and release run well in my PC.but if i copy my exe and image file to Arm based on WinCE5.0, my exe file can not run and show "OutOfMemoryExceptoin".
1.this is my way to initial images array:
private Bitmap[] bitmaps = new Bitmap[20];
public FormMain()
{
InitializeComponent();
bitmaps[0] = new Bitmap(".\\buttons\\bt1_on.bmp");
...
...
...
bitmaps[19] = new Bitmap(".\\buttons\\bt20_on.bmp");
}
2.all of my pictures files is about 993k
3.my device memory64M SDRAM
- 32bit databus
4.and when i exe file in my PC,it need 32M memory
thanks!!!!!!!!!
|
|
|
|
|
put a try catch block into your code and then you can see where the error is occurring and maybe make the images smaller
|
|
|
|
|
thank you. it's real a good idea. i 'll try to do it following your commnet.
|
|
|
|
|
How can i get the loaded images' path in WinCE.
i tried a lot and can't finished it.
|
|
|
|
|
WinCE has a max of 32Mb available to a single exe and you are using how much?
zh.again wrote: when i exe file in my PC,it need 32M memory
Who would have guessed!
Do you need to load ALL the bitmaps at start-up? If they are not all in use then don't load them all. You have limited resources available for a mobile device, so code accordingly.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
thank you for your help.
i've load all the bitmaps at start-up.i 've copied them to the same file path as exe files and i run exe file in my PC, no error happened.even if i deleted all images form my project,it need no less than 20M memory.
i am so puzzled....
|
|
|
|
|
I can use Session on login.aspx.cs.
so I used like this.
// Session["Id"]= id;
and I can see components of Session, when I type "Session".
but I can't use that another aspx.cs. page, for example, board.aspx.cs.
There are only two values. SessionPageStatePersister and SessionParameter.
That is all;;
I don't know why...
please let me know..
|
|
|
|