I am sorting a hash in Perl. I encountered an Out of memory error when running my Perl Script:
foreach $key (sort (keys(%hash))) {
....
}
How do I sort a hash that has tons of data?
Hi,
I have a Virtual Machine with MOSS 2007 (Enterprise), VS2008 and SQL 2005.
I want to start exploring 2010. I need to know what I need to get started.
Can I donwload 2010 beta from Microsoft Site? Can I just install it without any conflicts with existing setup?
Thanks.
I'm building a little script that will connect to an IMAP account and grab the content of the email and also the attachments. It works well for the most part, but when a really large file comes in, it causes the script to time out. Is there any way that I can check the file size before trying to grab it? I think that would be the simplest solution. Otherwise, I may have to upgrade to a server that has more memory.
Hi All,
How can I measure the speed of code written in Java?
I planning to develop software which will solve Sudoku using all presently available AI and ML algorithms and compare time against simple brute-force method. I need to measure time of each algorithm, I would like to ask for suggestions on what is the best way of doing that? Very important, program must be useful on any machine regardless to CPU power/memory.
Thank you.
I found OWSTIMER consume a lot of memory during create personal sites. (I have to pre-create personal sites for many users)
After googling I found some suggestion to restart OWSTIMER but it’ll grow up again after create several personal sites. So I have to restart OWSTIMER every hour.
Did you know any impact of restart OWSTIMER every hour?
Thank you
I have a C# application which sometimes cost the CPU very high. I want to see which part of the code cost most. But the Microsoft CLR Profiler only determins the memory usage, it's not meant for computational profiling according to here. Is there any tools to do this?
Thanks.
I want to create the activity which will load the images from Web by using urls and i want to load that images in list view and i want some specific text and properties of that image in front of that image like the image below Click to see Image.Is there any way to store that images temporarily in phones memory.So how can i do this activity please give me perfect solution so that i can complete my application.How can i load the images from web.
Basically -[UIApplication openURL:] would be perfect, if it wasn't for the fact that it doesn't work within the same application (at least on simulator -- if this works on device someone please tell me). It's not a super big deal though if it just relaunches w/o URLness since I can obviously just persist some data. The goal of this is to essentially free all memory in the application and call all of the loading procedures.
Is is bad practice to pass the Context to a constructor and save it as a private variable for internal use? The other option is to pass the Context as a parameter to methods that need it.
Which is the better option?
I have a feeling that passing to the constructor might result in memory leaks accidentally.
$fp_src=fopen('file','r');
$filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8');
while(fread($fp_src,4096)){
++$count;
if($count%1000==0) print ftell($fp_src)."\n";
}
When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file.
Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB.
What gives?
My Understanding
Static block is executed during class loading, If a class is already loaded then there is no way to load the class other than class reloading
Doubt/Question
1) Is there any time JVM reloads the class?
My Understanding
In Class Loading JVM loads source of the Java file, so it can not keep all thousands files source is a memory, it should discard the rarely used code and reload again when it is necessary and during reload JVM is not initializing static variables and locks again(may be using some tracking mechanism)
Doubt/Question
2) If my above understanding is incorrect then please correct me
Often we think that an antivirus or similar is more than sufficient,
but many clients could accomplish so many processes that it would
be more safe having a real sandbox environment like unix like OS.
Better virtual machine like VMWare, VirtualBox and similar sandabox,
or there are better ways to keep safe our privacy?
what is the difference between a variable declared as an auto and static?
what is the difference in allocation of memory in auto and static variable?
why do we use static with array of pointers and what is its significance?
I currently have a testing environment for web apps on a virtual machine.
The problem - i would like to keep IE 6 for testing and also have access to newer versions of IE as well.
How can i do this?
Thanks.
Hi,
I have a website deeloped in ASP.NET and I want it to be accessed via local URL, for eg: http://localhost/website20
I tried once but the CMS in my website started giving error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."
Please help about the steps I need to follow.
Consider this code:
const char* someFun() {
// ... some stuff
return "Some text!!"
}
int main()
{
{ // Block: A
const char* retStr = someFun();
// use retStr
}
}
My question is in the function sumFun() where is "some Text!!", stored (i think may be in some static area in ROM) and what will be its scope?
Will the memory pointed by retStr be occupied throughout the program or be released once the block A exits?
--
Thanks
I have this code in base class
protected virtual bool HasAnyStuff<TObject>(TObject obj) where TObject:class
{
return false;
}
In child class I am overriding
protected override bool HasAnyStuff<Customer>(Customer obj)
{
//some stuff
if Customer.sth etc
return false;
}
I am getting this error
'''Type parameter declaration must be an identifier not a type'''
What is it I am doing wrong here?
I have a class definition of the form
class X
{
public:
//class functions
private:
A_type *A;
//other class variables
};
and struct A_type is defined as
struct A_type
{
string s1,s2,s3;
};
Inside the constructor, I allocate appropriate memory for A and try A[0].s1="somestring";
It shows segmentation fault.
Is this kind of declaration invalid, or am I missing something
Hi, I have a structs action object instance that loads a variable from a properties file.I want it to happen only the first time the action is called, so in further executions its read from memory. Any hints ? Thanks.
I would like to have a button in my window such that if I click it (button) the window is closed.
I found out that I can close a window in the following way:
referenceToTheFrame.hide(); //hides the frame from view
refToTheFrame.dispose(); //disposes the frame from memory
But if I do this way, compiler complains:
Note: myProgram.java uses or overrides a deprecated API
Note: Recompile with -Xlint:deprication for details.
Do I do something unsafe?
Hi,
I am doing an App which access the gprs .I am facing problem when the user starts another application who uses gprs also like google maps .It takes it own heap memory ,after doing some operation on Maps app it calls OnLowMemory of my service .and my ui is also killed in background.
I am not getting any proper tutorial haw can i start my app when it is getting killed during onLowMemory ,or is there any other way to handle it .
Thanks in advance.
Hi,
I have a rdf file (file.trp) in n-triples format, where each line is:
"subject predicate object ."
I tried to use rdf_load in semweb/rdf_db to load it into memory, but failed. Here is what I tried:
?- rdf_load('file.trp').
?- rdf_load('file.trp', [format(triples]).
the manual says it supports xml and triples. But it only loads rdf xml files. How can I load such rdf triple file?
Thanks,
Li
Does a method which I check for with respondsToSelector have to actually exist?
What if I only define it in the interface part and fail to implement it? I'm looking at a poor-man's virtual function in Objective-C.
I am using a Dictionary to store data, and will be caching it. I would like to avoid server memory issues, and have good performance by limiting the size of the Dictionary<, either in size or number of entries.
What is the best method of doing this? Is there another class I should be considering other than a Dictionary?