Why is CompareAndSwap instruction considered expensive?
I read in a book:
"Memory barriers are expensive, about as
expensive as an atomic compareAndSet()
instruction."
Thanks!
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?
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 have configured a Virtual Directory on IIS 6.0 running under UserA.
AppPool for the same is configured under Network Services.
I have one WCF svc file running under it,
My question is:
Is it running on UserA Account Or Network Service?
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
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 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?
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
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 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?
$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?
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.
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 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?
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 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.
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)?
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.
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 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
good day
we are developing game for android and have some trouble with resource loading on high dpi devices.
our resources are located in res/drawable directory
on a standart dpi device the game work properly, but on hdpi (tested on HTC Desire) all resources which located in res/drawable-hdpi load are loaded correctly, but the resources which miss in drawable-hdpi directory but present in res/drawable are ignored
but everything works fine on the virtual device with hdpi.
does anybody encounter this problem and know how to solve it?
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?
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 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.