Can I set rails to use mysql with MEMORY as the DB engine? I never restart mysql, and rebuild the db so often I'd rather have it be fast. Having the memory db for running tests would be nice too.
EDIT: I should have specified this is for dev/testing only, not production.
...
Using Windows
So I'm reading from a binary file a list of unsigned int data values. The file contains a number of datasets listed sequentially. Here's the function to read a single dataset from a char* pointing to the start of it:
function read_dataset(char* stream, t_dataset *dataset){
//...some init, including setting dataset...
I have a request handler running in apache/mod_php which occasionally expands beyond the maximum allowed memory usage (ie, the memory_limit definition in in php.ini).
Handling this request calls proc_open() to run external commands. Is the memory usage of those commands counted "against" the requests memory usage?
Beyond that, what are...
Hi
I'm using 'malloc_error _break' to break on double free error.
The stack trace does not lead me to a specific line or object (only to the assembly code).
What I can see is the object address:
...malloc: *** error for object 0xfa1340: double free
How can I find which object this address represents? (0xfa1340)
(I tried to find it...
The IIS http log tells me the time taken, so it's easy to identify long-running requests. But how can I identify the memory consumption of each request thread?
From within the process code I can easily get the size of the workingset for the entire process, but not of a request thread itself.
IIS 6 + Framework 3.5
Nick
...
Hi!
I have some vectors of class A objects:
std::vector<A> *V1;
std::vector<A> *V2;
etc
there is a function with a vector of pointers of A:
std::vector<A *> *arranged;
what I need to do is put the vectors from V1, V2 etc inside arranged without destroying them in the end, so I thought that a vector of pointers to those objects...
On a production environment, how can one discover which Asp.Net http requests, whether aspx or asmx or custom, are causing the most memory pressure within a w3wp.exe process?
I don't mean memory leaks here. It's a good healthy application that disposes all it's objects nicely. Microsoft's generational GC does it's work fine.
Some reques...
I have a relatively large (in terms of memory use and code size) JS function (running in IE/FF) that I use only occassionally (like, a couple of times per day). I think I can get rid of it when I'm done with it by nulling out its function (using the variable name of the 'function object', as it were).
I am fuzzy though on how I would ge...
Over the past year I've made huge improvements in my application's Java heap usage--a solid 66% reduction. In pursuit of that, I've been monitoring various metrics, such as Java heap size, cpu, Java non-heap, etc. via SNMP.
Recently, I've been monitoring how much real memory (RSS, resident set) by the JVM and am somewhat surprised. ...
In C++, assuming no optimization, do the following two programs end up with the same memory allocation machine code?
int main()
{
int i;
int *p;
}
int main()
{
int *p = new int;
delete p;
}
...
Linux noob question:
If I have 500MB of RAM, and 500MB of swap space, can the OS and processes then use 1GB of memory?
In other words, is the total amount of memory available to programs and the OS the total of the physical memory size and swap size?
I'm trying to figure out which SNMP counters to query, but need to understand how L...
I can see that scala can solve the Producer-Consumer problem using actors. There is a couple of examples on the web but what is worrying me is the unlimited growth of an actor's mailbox.
Suppose the producer produces on a much faster rate than the consumer can consume. Using the traditional synchronized threads approach, I can set up a ...
Reading a few threads (common concurrency problems, volatile keyword, memory model) I'm confused about concurrency issues in Java.
I have a lot of fields that are accessed by more than one thread. Should I go through them and mark them all as volatile?
When building a class I'm not aware of whether multiple threads will access it, so s...
I always like to use the variable with the smallest size that will work just fine, But would this really gain me if I used short byte integers instead of integer, and the memory is 32bit word addressable, Does the compiler do something to enhance memory usage ?
...
I want to use a temporary MEMORY table to store some intermediate data, but I need/want it to support TEXT columns. I had found a workaround involving casting the TEXT to a VARCHAR or something, but like an idiot I didn't write down the URL anywhere I can find now.
Does anyone know how to, for example, copy a table x into a memory table...
Hi there
we're using memcache in several of our Rails applications.
Now I was wondering: Is there a way to get a list of all objects stored in memcache including the amount of data each value occupies?
E.g.:
key | memory(Bytes) | %
-----------------------------------
foo_key | 15013 | 0.3
bar_key | 2201 ...
Let's say we have an array of PRINTER_INFO_2 like this:
PRINTER_INFO_2* printers = (PRINTER_INFO_2*)malloc(sizeof(PRINTER_INFO_2) * 64); // room for 64 items
Then we call EnumPrinters() to get a list of locally installed printers:
EnumPrinters(
PRINTER_ENUM_LOCAL,
NULL,
2,
(LPBYTE)printers,
...);
Here's the stru...
Hi all,
Consider:
class A
{
public:
virtual void update() = 0;
}
class B : public A
{
public:
void update() { /* stuff goes in here... */ }
private:
double a, b, c;
}
class C { /* Same kind of thing as B, but with different update function/data members */
I'm now doing:
A * array = new A[1000];...
I'm writing a .SO that gets called by another program and I want to be able to flip a value in memory through a function in the .SO
What I have so far is :
int
axptrace( int numArguments, char* pMessageBuffer, int* pMessageBufferSize,
char* pData[], int* pDataLength[] )
{
printf("Beginning dump attempt..\n");
unsigned int* wkp...
When using memory-mapped files it seems it is either read-only, or write-only. By this I mean you can't:
have one open for writing, and later decide not to save it
have open open for reading, and later decide to save it
Our application uses a writeable memory-mapped file to save data files, but since the user might want to exit ...