Wierd resource disposal?
-
Hi, i have written a program and i am experiencing a wierd problem with the memory usage... once i open the program it will keep on draing more memory, it will never stop :D if i minimize the program the memory will dispose(?) and the program will drop to about 2-5mb and start growing again... is it a bug in .net or did i not read something correctly? I thank everyone for intrest in the problem
-
Hi, i have written a program and i am experiencing a wierd problem with the memory usage... once i open the program it will keep on draing more memory, it will never stop :D if i minimize the program the memory will dispose(?) and the program will drop to about 2-5mb and start growing again... is it a bug in .net or did i not read something correctly? I thank everyone for intrest in the problem
asator wrote:
is it a bug in .net or did i not read something correctly?
Impossible to say without knowing what your program does.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
asator wrote:
is it a bug in .net or did i not read something correctly?
Impossible to say without knowing what your program does.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
well it does make alot of httpwebrequests, operate on alot of strings(retreive data from the response, alot of string.substring and string.indexof calls) i think it has something to do with one of these... ps. i noticed in a memory profiler that the program has 112k string instances...wtf?
-
Hi, i have written a program and i am experiencing a wierd problem with the memory usage... once i open the program it will keep on draing more memory, it will never stop :D if i minimize the program the memory will dispose(?) and the program will drop to about 2-5mb and start growing again... is it a bug in .net or did i not read something correctly? I thank everyone for intrest in the problem
i would also like to ask another question, can i somehow 'call' the Form.Minimize method without the 'visual' efects? :D i mean something like simulating the minimze method in order to free the memory? maybe someone knows what is called when the form is minimzed?
-
Hi, i have written a program and i am experiencing a wierd problem with the memory usage... once i open the program it will keep on draing more memory, it will never stop :D if i minimize the program the memory will dispose(?) and the program will drop to about 2-5mb and start growing again... is it a bug in .net or did i not read something correctly? I thank everyone for intrest in the problem
asator wrote:
once i open the program it will keep on draing more memory, it will never stop
So if you do not minimize do you get a Sytem Out Of Memory Exception?
My pointless rants meragussa.blogspot.com[^]
-
asator wrote:
once i open the program it will keep on draing more memory, it will never stop
So if you do not minimize do you get a Sytem Out Of Memory Exception?
My pointless rants meragussa.blogspot.com[^]
i myself didnt get to the no memory state but alot of users(esspecially the ones with low amount of memory, 128mb and below), they report that after a long period of time, usally over 24h their system 'hangs', 'freezes', so no - there is no exception thrown
-
well it does make alot of httpwebrequests, operate on alot of strings(retreive data from the response, alot of string.substring and string.indexof calls) i think it has something to do with one of these... ps. i noticed in a memory profiler that the program has 112k string instances...wtf?
Try closing the
HttpWebResponse
s after you finished retrieval of data and try to minimize use of SubString as each return value is a new string object. Maybe you can use regular expression to be more efficient but it depends on what exactly you are doing.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Try closing the
HttpWebResponse
s after you finished retrieval of data and try to minimize use of SubString as each return value is a new string object. Maybe you can use regular expression to be more efficient but it depends on what exactly you are doing.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
1. what do you mean by closing? 2. here is an example of what i am doing:
strX[i] = strX[i].Substring(strX[i].IndexOf("href="));
strX[i] = strX[i].Substring(strX[i].IndexOf("ht"));
strX[i] = strX[i].Replace("amp;", "");there is much more of this and this is in a
for
loop with about 100 loops... so now i know how i got to 112k string objects... so can i do what i am doing in a better way?(i mean the substring issue) -
1. what do you mean by closing? 2. here is an example of what i am doing:
strX[i] = strX[i].Substring(strX[i].IndexOf("href="));
strX[i] = strX[i].Substring(strX[i].IndexOf("ht"));
strX[i] = strX[i].Replace("amp;", "");there is much more of this and this is in a
for
loop with about 100 loops... so now i know how i got to 112k string objects... so can i do what i am doing in a better way?(i mean the substring issue)1. By closing I mean calling its Close method[^]. 2. As said before you may be able to get rid of some SubString calls by using regular expressions.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
1. By closing I mean calling its Close method[^]. 2. As said before you may be able to get rid of some SubString calls by using regular expressions.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Hi, i have written a program and i am experiencing a wierd problem with the memory usage... once i open the program it will keep on draing more memory, it will never stop :D if i minimize the program the memory will dispose(?) and the program will drop to about 2-5mb and start growing again... is it a bug in .net or did i not read something correctly? I thank everyone for intrest in the problem