memory

java.lang.Error: "Not enough storage is available to process this command" when generating images

I am running a web application on BEA Weblogic 9.2. Until recently, we were using JDK 1.5.0_04, with JAI 1.1.2_01 and Image IO 1.1. In some circumstances (we never figured out exactly why), when we were processing large images (but not that large - a few MB), the JVM would crash without any error message or stack trace or anything. Th...

Can CUDA results be stored in an OpenGL accessible texture?

Can CUDA be used to generate OpenGL textures? I know it can be done by reading the CUDA results back into system memory, and then loading that into a texture... But I'd like to find a way to save this copy... Can CUDA be used to generate textures? ...

Bind texture with pinned mapped memory in CUDA

I was trying to bind a host memory that was mapped for zero-copy to a texture, but it looks like it isn't possible. Here is a code sample: float* a; float* d_a; cudaSetDeviceFlags(cudaDeviceMapHost); cudaHostAlloc( (void **)&a, bytes, cudaHostAllocMapped); cudaHostGetDevicePointer((void **)&d_a, (void *)a, 0); texture<float, 2, cudaR...

Decoding bitmaps in Android with the right size

I decode bitmaps from the SD card using BitmapFactory.decodeFile. Sometimes the bitmaps are bigger than what the application needs or that the heap allows, so I use BitmapFactory.Options.inSampleSize to request a subsampled (smaller) bitmap. The problem is that the platform does not enforce the exact value of inSampleSize, and I sometim...

StructureMap remove all disposed object references but leave configuration

Hy guys, I am currently trying to implement some custom ILifecycles for StructureMap. Depending on events the lifecycle is associated with all object should be removed from the lifecycle. Here is the registration for an object. I get a lifecycle from my manager for a plugintype and concretetype using a scope to determine the lifecycle....

allocating "unmanaged" memory in c#

Hi, I'm writting a program in c# that uses a C++ library, and for some reason I need to allocate an unmanaged buffer to pass it to the lib. Is there a way to do this in c# ? Basically I would just need to do a malloc in C#... Thanks ...

Ant build from Android-generated build file fails - how to fix?

Building our Android app from Ant fails with this error: [apply] [apply] UNEXPECTED TOP-LEVEL ERROR: [apply] java.lang.OutOfMemoryError: Java heap space [apply] at java.util.HashMap.<init>(HashMap.java:209) [apply] at java.util.HashSet.<init>(HashSet.java:86) [apply] at com.android.dx.ssa.Dominators....

If free() knows the length of my array, why can't I ask for it in my own code?

I know that it's a common convention to pass the length of dynamically allocated arrays to functions that manipulate them: void initializeAndFree(int* anArray, size_t length); int main(){ size_t arrayLength = 0; scanf("%d", &arrayLength); int* myArray = (int*)malloc(sizeof(int)*arrayLength); initializeAndFree(myArray, ...

android internal phone storage

how can you retrieve yours phone internal storage from an app? I found memoryinfo, but it seems that returns information on how much memory your currently running tasks. I am trying to get my app to retrieve how much internal phone storage is available. ...

UIImageJPEGRepresentation - memory release issue

On a iPhone app, I need to send a jpg by mail with a maximum size of 300Ko (I don't no the maximum size mail.app can have, but it's another problem). To do that, I'm trying to decrease quality until obtain an image under 300Ko. In order to obtain the good value of the quality (compressionLevel) who give me a jpg under 300Ko, I have made...

C++ stack memory still valid?

Hi all, If I create an object on the stack and push it into a list, then the object loses scope (outside of the for loop in the example below) will the object still exist in the list? If the list still holds the object, is that data now invalid/possibly corrupt? Please let me know, and please explain the reasoning.. Thanks, jbu cl...

C++ deleting a pointer

On this page, it's written that One reason is that the operand of delete need not be an lvalue. Consider: delete p+1; delete f(x); Here, the implementation of delete does not have a pointer to which it can assign zero. Adding a number to a pointer shifts it forward in memory by those many number of sizeof(*p) units...

C++: Unitialized variables garbage

int myInt; cout << myInt; // Garbage like 429948, etc If I output and/or work with unitialized variables in C++, what are their assumed values? Actual values in the memory from the "last user"? e.g.: Program A is closed, it had an int with the value 1234 at 0x1234 -> I run my program, myInt gets the address 0x1234, I output it like...

Detecting all memory changes in C

Is there a way I can find out all changes to memory by a particular piece of code( a function or a line of code ) without knowing in advance where I expect the changes(I want to watch the whole program memory space)? watch in gdb requires me to know what I expect is changing... ...

storage classes

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? ...

Visualization/parsing a memory dump - What' the prefered starting point?

Hi all, Background: I'm developing an embedded application in C using Metaware (Eclipse based) on an ARC processor. Debug is done via a JTAG interface. Problem: The application has a global structure in memory holding the entire system state. During testing and debugging I wish to get the current state and review it (on a win machine) ...

OutOfMemoryException - Dataset <-> XML <-> Dataset

Hello all I'm stuck in a huge problem where i need to handle huge data. I get a data set which has 5 datatables. One of the tables has around 3000 columns and 50,000 records. I need to save this dataset completely in the SQL database as XML and i need to retrieve it later. I CAN'T make any design changes to skip it. When i do dataset...

how much concurrent http request can erlang handle

I am developing a application for benchmarking purposes, for which I require to create large number of http connection in a short time, I created a program in java to test how much threads is java able to create, it turns out in my 2GB single core machine, the limit is variable between 5000 and 6000 with 1 GB of memory given to JVM after...

Python large variable RAM useage

Hi, Say there is a dict variable that grows very large during runtime- up into millions of key:value pairs. Does this variable get stored in RAM,effectively using up all the available memory and slowing down the rest of the system? Asking the interpreter to display the entire dict is a bad idea, but would it be okay as long as one k...

Virtual Memory and Paging

Hello, I am doing some exercices to understand how the virtual memory and paging works, my question is as follows : Suppose we use a paged memory with pages of 1024 bytes, the virtual address space is of 8 pages but the physical memory can only contain 4 frames of pages. Replacement policy is LRU. What is the physical address in main ...