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?
I'm trying to use the OpenCA library in a C++ application. However, when including the file pki_x509_data_st.h the following code fragment is encountered:
typedef struct pki_x509_callbacks_st {
/* ---------------- Memory Management -------------------- */
void * (*new) (void );
void (*free) (void *x );
void * (*dup) (void *x );
This won't compile because of the "new" pointer declaration.
How can I make it work?
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 was looking at AppFog's Pricing and they appear to be giving 2GB of ram away for free, to nonpaying customers. This seems unprecedented for PAAS provodes--providers like Heroku and App Engine remove the app from memory if it has been inactive for certain amount of time. Does cloudfoundry work similarly? Am I wrong in assuming that in a few years appfog servers will be filled with inactive non paying applications?
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'm implementing a program which gets text from various sites and checks which ones are most relevant to a query. The problem is that when I have breakpoints in my code it works perfectly well but without it, the program just freezes. Is this a memory issue? What can I do to solve this please?
THanks
I used strtol to convert a string to hex, now I need to print it to the screen. I'm not sure if I can use sprintf since I only have 20k of memory to use on this board. Alternatives welcome.
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
If I have a Facebook app, and my users agree to allow my app to access their information, photos, friends, etc, is it ethical to grab their information when they log in, and then saving it in memory so that the next time he goes to my app, it can load faster?
If so, what about when the user logged off? Is the right thing to do to is to delete all the cached information and photos that the user provided?
Has Facebook got any way to detect that we're doing this (saving their information, etc)?
we're in the process of installing a brand new Windows Server 2008 Web cluster and we would like to synchronize some files between the servers. The problem is that the DC in the domain is an old Windows Server 2003 Standard (NOT R2) which apparently doesn't contain some extension to the AD schema. Is it possible to upgrade the schema without upgrading the DC servers to R2?
When I try to create a Replication Group on the 2008 Server I get the following message:
---------------------------
Error
---------------------------
srv.XXXXXX.XX: The Active Directory Domain Services schema on domain controller
activedc07.srv.XXXXXX.XX cannot be read. This error might be caused by a schema
that has not been extended, or was extended improperly. See Help and Support
Center for information about extending the Active Directory Domain Services
schema. Schema version 30 is not supported.
---------------------------
OK
---------------------------
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 there a more efficient way than using numpy.asarray() to generate an array from output in the form of a list?
This appears to be copying everything in memory, which doesn't seem like it would be that efficient with very large arrays.
(Updated) Example:
import numpy as np
a1 = np.array([1,2,3,4,5,6,7,8,9,10]) # pretend this has thousands of elements
a2 = np.array([3,7,8])
results = np.asarray([np.amax(np.where(a1 > element)) for element in a2])
I was wondering how Java sorts items in the Map (HashMap or Hashtable) when they are added. Are the keys sorted by the hashcode, memory reference or by allocation precedence...?
It's because I've noticed same pairs in the Map are not always sorted in the same order
I want to dynamically set the content of an iframe to that of an html document I have. It is in the form of a string in memory in javascript.
Then i want to print that iframe.
Ideas?
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.
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?
Hi,
Let's assume that I have a vector
r <- rnorm(4)
and a matrix W of dimension 20000*200 for example:
W <- matrix(rnorm(20000*200),20000,200)
I want to compute a new matrix M of dimension 5000*200 such that m11 <- r%*%W[1:4,1], m21 <- r%*%W[5:8,1], m12 <- r%*%W[1:4,2] etc. (i.e. grouping rows 4-by-4 and computing the product).
What's the optimal (speed,memory) way of doing this?
Thanks in advance.
Hi -
In my shell script, I am trying to search using terms found in a $sourcefile against the same $targetfile over and over.
My $sourcefile is formatted as such:
pattern1
pattern2
etc...
The inefficient loop I have to search with is:
for line in $(< $sourcefile);do
fgrep $line $targetfile | fgrep "RID" >> $outputfile
done
I understand it would be possible to improve this by either loading the whole $targetfile into memory, or perhaps by using AWK?
Thanks
I was doing some work handling a lot of information and my partner told me that I was using too many matrices to manipulate the variables of the problem. The idea was to use one dimension arrays int a[] instead of the 2 dimensional arrays int b[][], to save memory and processing speed of the algorithm. How certain is that this change will accelerate the speed of execution or compilation of my code in c ++?
At work we use SAS to manipulte large amounts of data everyday on our workstations. To give an indication of scale the largest merges we had to do was merging 24 files of 2GB in size each together into one big file (if you are familiar with SAS the files are binary compressed too!). If we upgrade our PCs to core i7 then which of Core i7 975 or Core i7 960 is better? The main difference between the two seems to be QPI. So does that affect large scale data processing such as merge datasets in SAS?
In SQL Server, you can declare a table variable (DECLARE @table TABLE), which is produced while the script is run and then removed from memory.
Does Oracle have a similar function? Or am I stuck with CREATE/DROPs that segment my hard drive?
I have put some instructions in onLowMemory() callback and want to test the same. Is there a "direct" way to test onLowMemory function of the application subclass?
Or will I have to just overload the phone by starting many apps and doing memory intensive tasks?
Thanks.