|
Max,
I found a hit via Google on this problem...
Google is my friend
Basically you may be hitting a threshold limit for the ArrayList structure so even if you give it more memory there is no guarantee that it will use it all.
I strongly suggest that you look at virtualizing this data because even if you do somehow happen to get it running with 3GB memory, you may find that just one small change to the input will push the limits again.
Another approach may be to limit the size of each list entry by compressing each entry so that the ArrayListitself uses less memory.
...Steve
|
|
|
|
|
Steve,
Do you think that even if I get a Windows 64 machine with 16GBRAM or more, I will have access only to 2GB RAM data for each .NET object(ArrayList, Hashtable, etc.) ?
What about pure arrays: are they limited too to the int32 limitation?
Will .NET 2.0 fix this ?
Now for my problem: actually I did not realize how expensive using ArrayList is...
Each of the 15 million+ State are very small; probably 90% have less than 2 outgoing transitions.
I replaced the embedded ArrayList {char,int,char,int...} with two synch pure arrays char[] and int[], and now the whole thing gets stored in approx. 600 MB, which is fine (for now).
Thanks
Max
|
|
|
|
|
There's nothing "tunable" or configurable as far as the .NET memory manager is concerned.
Also, running the system out of handles can also cause the same problem. If you'r not freeing an unmanaged resource or not Disposing of some types of objects properly, you'll run into the same problem.
What are you using that's taking up all this memory?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a Hungarian dictionary (several dozen millions of word forms) that I need to store into a Search tree.
The search tree is basically an ArrayList of states; each state has the following fields:
public class DState
{
ArrayList CharsToDests;
int infonb;
int canonical;
(... and then the methods)
}
in which CharsToDests contains alternatively characters, and their corresponding outgoing state index, e.g.:
('a',23,'b',3456,'c',1200023,'d',57)
For some reason I don't understand, my ANTS profiler says each state consumes 20 bytes (I would have thought 4x3 = 12).
BTW, do you know how much memory such an ArrayList takes? would it be better to use two synchronized type-consistent ArrayList, e.g.:
ArrayList Characters;
ArrayList OutgoingStateNb;
or something else (I cannot use an array because these lists grow: I just need a list of chars and a list of int).
Anyways, after having stored 5 million words,
that gives me approx. 50 million states, with the connections in the Arraylist => I get approx. 2GBRAM and then the Out of Memory exception (that I cannot catch).
--Max
|
|
|
|
|
Sounds like you need to use a database rather than in-storage arrays.
...Steve
|
|
|
|
|
Silberztein wrote:
('a',23,'b',3456,'c',1200023,'d',57)
For some reason I don't understand, my ANTS profiler says each state consumes 20 bytes (I would have thought 4x3 = 12).
Did you also account for the boundry padding between fields and array elements?
Also, an ArrayList, or any other array for that matter, can only be indexed by a 32 bit integer and, therefore, can only hold a maximum of Int32.MaxValue , which is about 2.147 billion, elements. Try and exceed this limit, and you'll get an OutOfMemory exception.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
> Also, an ArrayList, or any other array for that
> matter, can only be indexed by a 32 bit integer
> and, therefore, can only hold a maximum of
> Int32.MaxValue, which is about 2.147 billion,
> elements. Try and exceed this limit, and you'll
> get an OutOfMemory exception.
is this limit also true for Windows 64?
for .NET 2.0 ?
--Max
|
|
|
|
|
Don't know. I would suspect the indexer limit would be the same size as the processor data width.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
> What are you using that's taking up all this memory?
I was using an array of 15 million states:
public class State
{
ArrayList transitions; // {char,state,char,state...}
int infonb;
int canonicalstate;
}
I did not realize how expensive the ArrayList is. Since most states have less than 2 outgoing transitions, I replaced the arraylist with two synch pure arrays:
public class State
{
char[] char;
int[] targetstate;
int infonb;
int canonicalstate;
}
and that came to 1/3 of the previous memory usage.
--Max
|
|
|
|
|
Hi,
I get error
"Couldn't get process information from remote machine" when i try to run Process.GetProcesses().I understand that this is because i dont have administration rights.How can i solve this problem.Is there a way where in i can give some permissions to the user to execute that part of code alone.
Hope to get replies soon.
Thanks
|
|
|
|
|
The user account running the code must have Admin rights to the remote machine in order to get it's Process list. There is no way around this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When developing Word Add-in programs and I want to insert a file into my currently open file I normally do the following:
object nRef = Type.Missing;
doc.Bookmarks.Item(ref oEndOfDoc).Range.InsertFile("c:\\temp\\filetobeinserted.doc",ref nRef,ref nRef,ref nRef,ref nRef);
My question is how do I do this when I want to insert a password protected file into my open file? I know the password for the file so I can supply this programmatically (I'm not concerned with possible security issues associated with this approach).
Any help would be much appreciated.
|
|
|
|
|
Hai,
In my Application i need to give the chance to the change the Property to any controls (say textbox,datagrid etc.,) Is it Possible to show the Property Window in Runtime... Help Me.
|
|
|
|
|
No, the property window is just enumerating the properties of the control. You'd have to write your own window to do the same thing in your code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Right-Click the ToolBox --> Add/Remove Items --> Check PropertyGrid (namespace System.Windows.Forms) --> Press OK --> Drag it to your Form.
The PropertyGrid.SelectedObject property is the object who's properties will be shown. In designtime you can only select a Component, but it can be any object you wish if you specify it at runtime.
Hope this helps!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Really ? Wow. I did not know that...
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Now you do!
When i'm testing a new control, i always make a toolwindow with a propertygrid, so i can set all the control-properties. I love the propertygrid...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I wonder if anyone can help. I need to take data from a dataset/datatable in vb.net and do a word mail merge with it.
Obviously i have to CreateObject word application, and give it a document etc.
But then how do i do the actual mail merge. how do i put the data from my table into the fields in the mail merge document?
If you have some sample code i could look at or could explain it, i would be grateful
|
|
|
|
|
|
hi,
What does .net stand for? or What is the .net original name?
Thanks
|
|
|
|
|
Mark Anthony Sabado wrote:
What does .net stand for?
It's just a generic term for the Internet and distributed applications, e.g., mobile devices.
Mark Anthony Sabado wrote:
What is the .net original name?
It was originally called NGWS - "Next Generation Windows Services."
Kevin
|
|
|
|
|
hi
i have some experience in c++ and vc++
i want to migrate to .net
would u tell me which language should i learn first for .net??
ive heard that c# is the mother of .Net .so i should learn c# first or go directly to visual c++.net??
thx
|
|
|
|
|
whatever you want i think. if you most like C++, use C++.NET, otherwise, C#, VB.NET, etc will work the same way.
what only mathers is the framework. all these languages depend only on the framework (if they are well written) because they call only framework functions...
so, calling in C++ System::Console::WriteLine() or in VB/C# System.Console.WriteLine() would behave the Same I believe.
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I think you'll find it easier to learn C# first. Learn C++.NET (i.e., Managed C++ or C++/CLI) only if you have specific problems which require those languages, otherwise you'll just get confused.
Jesse Liberty's Programming C# is a good book for C++ developers who want to get up to speed quickly. However, one thing to be aware of is that his recently-released 4th edition covers C# version 2. The 3rd edition focuses on C# for .NET 1.1.
Otherwise just learn from online tutorials.
Kevin
|
|
|
|
|
hamidreza_buddy wrote:
ive heard that c# is the mother of .Net
LOL - that's great.
C# is definately easier to learn than C++.NET, and I'd recommend it. I use C# much more than MC++, and I'm a C++ MVP, so I know my C++ pretty well. I just find C# to be better, MC++ is a hack on the side of C++.
Christian Graus - Microsoft MVP - C++
|
|
|
|