Why is CompareAndSwap instruction considered expensive?
I read in a book:
"Memory barriers are expensive, about as
expensive as an atomic compareAndSet()
instruction."
Thanks!
Hi,
list<Dog*> dog;
.............
............
So I added many dog objects to it.
If I call dog.pop_front();
Does memory automatically gets deallocated ?
I need some help in setting up a dumb-terminal type concept for Windows machines.
We have a computer lab with 40 computers, all of them are ageing. Unfortunately, we don't have enough funds to get all of them replaced.
On the other side, we have very powerful rack servers which are quite underutilized.
I was thinking of a solution which would enable those lab computers to use the rack servers. Remote desktop is an option, but I wanted something that is more transparent to the end user.
Are there any free or low cost solutions for such an scenario??
Thanks
Does closing a java.sql.Connection also close all the statements, prepared statements, etc. obtained from that connection? Or is there going to be memory leak if I close the connection but leave the statements, etc. unclosed?
Hi, I just encounter a strange problem:
var a:ClassA = new ClassA;
var b:ClassA = a;
The program keeps running sometime, the a = null, b = null.
The program is a complex one, I am sure that no part will touch a, and b. My question is, will the runtime(garbage collector) to collect the memory of "a" and then assign a and b to null?
I am confused, thanks!
I have a one-time process (hashing all our user passwords) written using datasets. The performance needs improvement so we've profiled the application and found that increasing the 'batch size' of the update will improve performance. I also know that if I load the entire data set into memory the application will start hitting swap and slow down.
The question is: how big is a System.Data.DataRow derived class? I'd like to calculate a batch size which I know won't force the application into swap.
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.
I have an issue in the mind and that is since the jump instruction changes EIP register by adding signed offsets to it(if I'm not making a mistake here), on IA-32 architecture how would going upward in memory from location 0x7FFFFFFF(biggest positive number in signed logic) to 0x80000000(least negative number in signed logic) be possible? or maybe there shouldn't be such jump due to the nature of signed logic?
For a school project, I've registered a free VPS on a hosting provider (pipni.cz). It has 256MB RAM:
Mem: 262144k total, 148104k used, 114040k free, 0k buffers
It's running on Debian Squeeze.
I always get this error when I run a Java program:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I tried to use Xms, Xmx, Xss with low values and still same result. ulimit -v gives me "unlimited".
My application will be pretty simple and I need to use rmiregistry also. Can somebody help?
how can i modify the method in memory so it makes new objects with that modified method?
for example i want to modify or add page_init handler on runtime for the next time the page loads?
see this also for clarification: http://stackoverflow.com/questions/3005338/page-load-another-handler
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
I run some processes on an EC2 cc2.8xlarge instance which has 32 virtual processors.
For some type of processes, when I run 16 processes on parallel, all of them use 100% of CPU cycles. But for other type of processes, they are not using 100% CPU and they finish considerably slower than a single thread.
There is no time spend on IO and all data is served from memory. Do you have any idea about the reason of this problem?
How can I tell if the repair shop stole my hard drive? I had my computer in the shop for a couple of days to get a diagnostic check and he quoted me $130.
I have a family member who said he would do it for $30 so I rejected the offer and requested it back. When he returned it I hooked it back up and now I get a low disk space warning; when I dropped it off I had at least 50 gb of space left, on a total of 149 gb and all my pictures movies, and music are gone.
Can I find if he indeed did steal my hard drive or something?
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 have some questions about singletons in C++.
Under what situations is a singleton a must?
What are the pros and cons of singletons? I was told they could cause memory leaks, how is that? I was also told that initialization is a problem, is that true?
As I remember there is a magic command line option in Java that turn on writing of operations that are currently executed to console. The output was looked like byte code. I do not mean -verbose, because it prints only class loading, while this option outputs information like memory allocation etc.
$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?
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 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
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.
I apologize in advance if this is a basic question, but I am quite confused after reading the Apache documentation and other tutorials.
Does a single Apache prefork process serve all HTTP requests for a given client? That's what I thought, but when I reduce maxclients down to a low number, my page load times go to a crawl. This despite the fact I'm the only client on the server in question. This would suggest each process serves a single HTTP request at a time, rather than serving all requests within the TimeOut window.
So if a single webpage requires 15 HTTP requests to load fully, do I require 15 prefork Apache processes to optimally serve it?
Which CMS are you using in Java and what is your experience with it (in terms of extensibility, usage comfort, framework API, memory usage, performance etc.). I am looking for suggestions.
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.
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)?
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?