Click here to Skip to main content
15,921,905 members
Home / Discussions / C#
   

C#

 
QuestionWeb service that accesses an Access database with input from/output to a web app? Pin
Red_Wizard_Shot_The_Food22-Feb-06 6:31
Red_Wizard_Shot_The_Food22-Feb-06 6:31 
Questionadding arrows to buttons Pin
Dsypher22-Feb-06 6:30
Dsypher22-Feb-06 6:30 
AnswerRe: adding arrows to buttons Pin
Alomgir Miah22-Feb-06 7:44
Alomgir Miah22-Feb-06 7:44 
GeneralRe: adding arrows to buttons Pin
Dsypher22-Feb-06 15:24
Dsypher22-Feb-06 15:24 
Questionuninstall in remote system Pin
sendmadhavan22-Feb-06 5:35
sendmadhavan22-Feb-06 5:35 
Questiongarbage collection Pin
zhujp9822-Feb-06 5:25
zhujp9822-Feb-06 5:25 
AnswerRe: garbage collection Pin
Judah Gabriel Himango22-Feb-06 6:23
sponsorJudah Gabriel Himango22-Feb-06 6:23 
AnswerRe: garbage collection Pin
Guffa22-Feb-06 9:16
Guffa22-Feb-06 9:16 
That depends on the scope of the references you use. If you don't have references the previous arrays, the memory will be garbage collected when needed.

You should remove the reference (e.g. setting it to null) as soon as you don't need any of the arrays.

If the references may still point to old arrays when you enter the method, you'd better release those before you allocate the new arrays:

start_volumn = null;<br />
pre_volumn = null;<br />
post_volumn = null;<br />
best_end_volumn = null;<br />
start_volumn = new double[TP];<br />
pre_volumn = new double[TP];<br />
post_volumn = new double[TP];<br />
best_end_volumn = new double[TP];


This way the memory will be available for garbage collection if needed. If you don't do this, the reference will not be released until the new array is allocated and the new reference replaces the old.

If possible, you should consider reusing the same arrays instead of allocating new ones over and over.

---
b { font-weight: normal; }

GeneralRe: garbage collection Pin
Colin Angus Mackay22-Feb-06 11:28
Colin Angus Mackay22-Feb-06 11:28 
GeneralRe: garbage collection Pin
Guffa22-Feb-06 11:42
Guffa22-Feb-06 11:42 
GeneralRe: garbage collection Pin
Colin Angus Mackay22-Feb-06 11:50
Colin Angus Mackay22-Feb-06 11:50 
QuestionConvert String to decimal Pin
cppdotnet22-Feb-06 3:51
cppdotnet22-Feb-06 3:51 
AnswerRe: Convert String to decimal Pin
Judah Gabriel Himango22-Feb-06 4:10
sponsorJudah Gabriel Himango22-Feb-06 4:10 
GeneralRe: Convert String to decimal Pin
cppdotnet22-Feb-06 4:16
cppdotnet22-Feb-06 4:16 
GeneralRe: Convert String to decimal Pin
Judah Gabriel Himango22-Feb-06 4:29
sponsorJudah Gabriel Himango22-Feb-06 4:29 
GeneralRe: Convert String to decimal Pin
Dan Neely22-Feb-06 4:37
Dan Neely22-Feb-06 4:37 
GeneralRe: Convert String to decimal Pin
Judah Gabriel Himango22-Feb-06 4:44
sponsorJudah Gabriel Himango22-Feb-06 4:44 
GeneralRe: Convert String to decimal Pin
cppdotnet22-Feb-06 5:02
cppdotnet22-Feb-06 5:02 
GeneralRe: Convert String to decimal Pin
Dan Neely22-Feb-06 6:15
Dan Neely22-Feb-06 6:15 
GeneralRe: Convert String to decimal Pin
Qhalis22-Feb-06 4:59
Qhalis22-Feb-06 4:59 
QuestionHaving Scrollbars to MDI form? Pin
majidbhutta22-Feb-06 3:50
majidbhutta22-Feb-06 3:50 
AnswerRe: Having Scrollbars to MDI form? Pin
Judah Gabriel Himango22-Feb-06 7:13
sponsorJudah Gabriel Himango22-Feb-06 7:13 
QuestionSave with date format Pin
mostafa_h22-Feb-06 3:29
mostafa_h22-Feb-06 3:29 
AnswerRe: Save with date format Pin
Judah Gabriel Himango22-Feb-06 4:03
sponsorJudah Gabriel Himango22-Feb-06 4:03 
GeneralRe: Save with date format Pin
mostafa_h22-Feb-06 4:45
mostafa_h22-Feb-06 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.