Click here to Skip to main content
15,914,312 members
Home / Discussions / C#
   

C#

 
QuestionProblem ion Creating XML FIles Pin
farhan197614-Oct-06 21:37
farhan197614-Oct-06 21:37 
AnswerRe: Problem ion Creating XML Files Pin
Larantz15-Oct-06 3:06
Larantz15-Oct-06 3:06 
QuestionHow can I list all functions in a Win32 dll? Pin
Igor Lima14-Oct-06 20:50
Igor Lima14-Oct-06 20:50 
AnswerRe: How can I list all functions in a Win32 dll? Pin
Corinna John14-Oct-06 22:36
Corinna John14-Oct-06 22:36 
AnswerRe: How can I list all functions in a Win32 dll? Pin
Dave Kreskowiak15-Oct-06 4:09
mveDave Kreskowiak15-Oct-06 4:09 
Questionmulti dimension array in an attribute Pin
Thomas Guilbault14-Oct-06 20:33
Thomas Guilbault14-Oct-06 20:33 
QuestionGetting info from a Access database Pin
spepperchin14-Oct-06 18:59
spepperchin14-Oct-06 18:59 
QuestionGetting better memory performance Pin
kshet2614-Oct-06 16:40
kshet2614-Oct-06 16:40 
I am tring to read in a massive file and its contents into an array like structure, so i have:


struct allInfo
{
public byte rating;
public ushort movieId;
public uint id;

}


public static ArrayList createMasterArray()
{
Console.WriteLine("Reading the contents from the file(quickFileLite.csv)");
StreamReader s = File.OpenText("D:\\www\\data\\quickFileLite.csv");
int entryCounter = 0;
allInfo values;
string read;
ArrayList masterArray = new ArrayList();
string[] split;
split = new string[3];
uint id;
ushort movieId;
byte rating;
char[] splitter = {','};
int loc=0;
while ((read = s.ReadLine()) != null)
{
split = read.Split(splitter);
id = uint.Parse(split[0]);
movieId = ushort.Parse(split[1]);
rating = byte.Parse(split[2]);

loc = entryCounter-1;
values.id = id;
values.movieId = movieId;
values.rating = rating;
masterArray.Add(values);
entryCounter++;
split = null;

}
s.Close();
return masterArray;
}

As it is right now at about 50 million (about half the file) entries to the ArrayList, it takes up about 1.077GB. Does anyone see any way that I could optimize the code to have as small a memory footprint as possible?
AnswerRe: Getting better memory performance Pin
Nader Elshehabi14-Oct-06 18:02
Nader Elshehabi14-Oct-06 18:02 
AnswerRe: Getting better memory performance Pin
leppie14-Oct-06 19:47
leppie14-Oct-06 19:47 
AnswerRe: Getting better memory performance Pin
Guffa15-Oct-06 1:17
Guffa15-Oct-06 1:17 
GeneralRe: Getting better memory performance Pin
kshet2615-Oct-06 8:00
kshet2615-Oct-06 8:00 
AnswerRe: Getting better memory performance Pin
Guffa15-Oct-06 12:12
Guffa15-Oct-06 12:12 
AnswerRe: Getting better memory performance Pin
Guffa15-Oct-06 14:52
Guffa15-Oct-06 14:52 
AnswerRe: Getting better memory performance Pin
WillemM15-Oct-06 1:22
WillemM15-Oct-06 1:22 
QuestionWMI not working. Did I forget something? Pin
junus14-Oct-06 14:09
junus14-Oct-06 14:09 
AnswerRe: WMI not working. Did I forget something? Pin
Dave Kreskowiak14-Oct-06 19:31
mveDave Kreskowiak14-Oct-06 19:31 
QuestionListView SubItem Rollover Pin
smarttom9914-Oct-06 13:42
smarttom9914-Oct-06 13:42 
AnswerRe: ListView SubItem Rollover Pin
Nader Elshehabi14-Oct-06 14:20
Nader Elshehabi14-Oct-06 14:20 
GeneralRe: ListView SubItem Rollover Pin
smarttom9914-Oct-06 15:36
smarttom9914-Oct-06 15:36 
QuestionApplication freezes ... Pin
Jad Jadallah14-Oct-06 12:29
Jad Jadallah14-Oct-06 12:29 
AnswerRe: Application freezes ... Pin
Dave Kreskowiak14-Oct-06 19:29
mveDave Kreskowiak14-Oct-06 19:29 
AnswerRe: Application freezes ... Pin
S. Senthil Kumar15-Oct-06 7:31
S. Senthil Kumar15-Oct-06 7:31 
QuestionHow to go to next window Pin
Yustme14-Oct-06 11:03
Yustme14-Oct-06 11:03 
AnswerRe: How to go to next window Pin
Nader Elshehabi14-Oct-06 13:22
Nader Elshehabi14-Oct-06 13:22 

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.