234 Topics

Member Avatar for
Member Avatar for grh1107

currently I'm rewriting old euler solutions into classes so i can store them in a library. I wrote a program that digitizes a number so it can check to see if it a pallindrome, The base class digitize dynamically allocates memory for the size of a number and stores each …

Member Avatar for mike_2000_17
0
247
Member Avatar for MastAvalons

I think there are memory leak in my application, perhaps the problem is in a part of code status = myPubSubSubscribe.Receive(fsReceivedTopic, myBufferSubscribe, myHeader, 0); if (status == PS_ENGINE_UNAVAIL) { printf("Unable to connect to the pubsub engine: %s\n", PSPubSub::Status2String(status)); myBufferPublish.FreeBuffer(); myBufferPublish.~PSBuffer(); myPubSubPublish.~PSPubSub(); myBufferSubscribe.~PSBuffer(); myPubSubSubscribe.~PSPubSub(); return; }

Member Avatar for Topiary
1
207
Member Avatar for Chuckleluck

The title explains it well. I wish to know which variables I need to delete when my program closes. I assume you don't have to use the delete keyword on *every* variable that you initialize. Thanks in advance.

Member Avatar for Chuckleluck
0
212
Member Avatar for citizen5

Small part of my code: `GetWindowThreadProcessId(hWnd, &dwID);` `hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, dwID);` `string value =" [_this] exec \"\\newfolder\\scripts\\start.sqf\"";` `WriteProcessMemory(hProcess, (LPVOID) 0x09BA3F95, (LPVOID) &value, sizeof(&value), NULL);` I am 100 % sure it has to do with my `value` being a `string` but I haven't found anything helpful elsewhere, even though I've …

Member Avatar for citizen5
0
507
Member Avatar for rahim_fayaz

Hi I am getting this error when running a very similar code like the below. I have memory problem,but i dont know how can solve it. please help. Thanks in advance. /////////////////////////////////////////// ~~~~~~~ERROR~~~~~~~~ terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted /////////////////////////////////////////// ~~~~~~~~Code~~~~~~~~~ int main(){ /** Declare …

Member Avatar for rahim_fayaz
0
136
Member Avatar for sah

For some days I have been trying to optimize an image processing program (cropping, rotate, changing brightness and undo) written in c# 4.0. Getting suggestions from google I have optimized the code in many ways. At first some disposable objects hadn’t been disposed that’s why exception was shown. But I …

Member Avatar for sah
0
1K
Member Avatar for janet@123

I am trying to use the glib HashTable implementation for my code and facing some issues in memory allocations. The code I've written is: GHashTable *g_hash_table; g_hash_table = g_hash_table_new (g_direct_hash, g_direct_equal); gint *port, *src_value, *value; guint32 *dst_key, *key; . . . while(1) { key = g_malloc (sizeof *key); dst_key = …

0
126
Member Avatar for Midgard

Hi- I have a script that grabs a lot of information for a page that has a 'Research Mode.' Basically, it grabs a bunch of data, then uses JS to show or hide info based on user criteria. It used to work fine, but we've been adding more info -- …

Member Avatar for Biiim
0
186
Member Avatar for glut

How can I read memory from a selected process? I'm using the [ReadProcessMemory](http://msdn.microsoft.com/en-us/library/windows/desktop/ms680553%28v=vs.85%29.aspx) function and I don't understand the 2nd parameter (lpBaseAddress). Could anyone help me with this, or tell me another way to read memory from a process? This is my function for reading memory, which I pulled off …

Member Avatar for glut
0
899
Member Avatar for Labdabeta

I am working on a game making (or really just general program making, but my question applies to games) DLL for opengl. It is almost done but the collision detection is a little bit slow since it has to calculate bounding boxes for each object repeatedly. I was thinking of …

Member Avatar for Labdabeta
0
168
Member Avatar for niyasc

Following is the one of code written by me for shared memory. Problem is that program donot come outside from marked loop and read numbers infinitely. "common.h" [CODE] struct common { int a[10],b[10],c[10],flag; }; [/CODE] p1.c [CODE] #include<stdio.h> #include<unistd.h> #include<stdlib.h> #include<sys/shm.h> #include"common.h" int main() { int running=1; void *shm=(void *)0; …

Member Avatar for niyasc
0
209
Member Avatar for freedomflyer

I am running into (pretty serious) valgrind issues as I run my application. As far as I can tell, my BST has some memory loss, to put it rather clinically. I've tried to create the right destructor on my BST<T> class, which contains BSTNode<T> nodes (both are shown below in …

Member Avatar for mike_2000_17
0
584
Member Avatar for CityThrille

Guys. I need help. I got a problem here about these newly-bought flash drive. Let me tell the story. Last days of December, 2011, my sister bought a new [I]Transcend JetFlash V30[/I] 8 GB USB Flash Drive as a gift for New Year's Eve. Then two days later, when I …

Member Avatar for caperjack
0
439
Member Avatar for Surfsup

I have a simple script (below) that on click (to the element with an id of #addClass) adds a class (.switcher) to the body tag. The script uses jquery. I would like to know if it's possible to modify this script so that when the user moves on to the …

Member Avatar for Surfsup
0
332
Member Avatar for CKShia

What is meaning of "nature of entity"? e.g. kind of function, global variable? Is there any code to check it? Also, how to detect the memory section in memory map? e.g. environment, command line arguments, code/, global initialized data, global uninitialized data, stack, heap etc. Is there any code to …

Member Avatar for Ancient Dragon
0
197
Member Avatar for Labdabeta

I have a program that dynamically allocates an array and uses it. The thing is that under certain situations this array will get infinitely long. As such I would like to know if/when the array has gotten too long and then start saving it to a file (where length will …

Member Avatar for Labdabeta
0
170
Member Avatar for MastAvalons

 class A {    public :          list< string> getList (){                 list< string> l;                 l.push_back ("str1");                 l.push_back ("str2"); ....         …

Member Avatar for mike_2000_17
0
168
Member Avatar for desup

Hi, I am new to java and I need to work with arrays. I have found some tutorials, but everywhere was something like [CODE] int[] anArray; // allocates memory for 10 integers anArray = new int[10]; [/CODE] But what if I dont know how long the array will be? When …

Member Avatar for desup
0
149
Member Avatar for radiat

I've a question on dynamic memory. As i understand it, i can create a dynamic memory array using: xxx= new int [z]; Then I can set the value of 'z' to be whatever value i want during the program. But if i create a dynamic memory array using a predefined …

Member Avatar for Bench
0
190
Member Avatar for niyasc

I'm trying to design Programmable Logical Array using c language. Due to lack of time I downloaded code for tabulation from internet. Now I have modified it to return f and f' in a character array. It works fine for some functions. But it shows memory allocation problem for some …

Member Avatar for Abhineet.Ayan
0
262
Member Avatar for Labdabeta

I have some code in C++ that uses an std::vector of std::strings to store an array of strings. I need to convert it into C. I thought that I would just create c versions of the functions I need (vector.back,vector.push_back,string.operator+=) but am getting lost in the double pointers. Can anybody …

Member Avatar for Ancient Dragon
0
176
Member Avatar for Connavar3

Hi everyone! I have written a server client that receives information, does a database transaction and then sends the result back to the client. My client has requested that they be able to view what was received and what was sent in real time. I have used a JTextArea. The …

Member Avatar for Connavar3
0
406
Member Avatar for ashishgh

I have created an application which creates multiple webbrowser controls at runtime...now i want to clean up memory when these webrowsers are deleted see the code below please let me know how can i do it(i have tried dispose method but no luck) Creation on dynamic web browsers on button …

Member Avatar for codeorder
0
263
Member Avatar for LateNightCoder

In my program I read in a text file an decrypt the text from an array. once decrypted i then have to do through it again and search for every tenth array member and show their memory location. The code so far: [CODE] int main( ) { int* pCrypted = …

Member Avatar for LateNightCoder
0
293
Member Avatar for mah300274

I am looking for a reasonably priced computer for sale (to build). I built one last year but pretty much returned everything in the end / tiger shipped half my items doa, short story short, I switched to newegg. I have been watching the new am3+ with amd's 8-core cpu …

Member Avatar for Odie1978
0
253
Member Avatar for Malaoshi

Hi, I am still new to C# and am working on an annotator: 1. Input some Chinese Text. 2. Click Button. 3. Output some Chinese Text - each word that's found in the dictionary get's a span-html-class around for later implementing it in a website. Here it the code for …

Member Avatar for thines01
0
634
Member Avatar for Dante2

Ok, I am walking my way through an instructional php book and basically going over the basics again. After I finished doing the script the way the book said to do it, I kept getting a header error saying that the headers have already been submitted. The book had my …

Member Avatar for Dante2
0
187
Member Avatar for vinithktp

Hi, I am facing OutOfMemory exception in Java, Kindly help me to resolve this issue, really appreciate your help [U][B]ERROR: [/B][/U]java.lang.OutOfMemoryError: Java heap space [B][U]CODE:[/U][/B] [CODE] public Blob getBlob(String databaseInstance, InputStream inputStream) throws SQLException, Exception { applog.info("Entering getBlob"); InputStream stream = null; applog.info("inputStream : " + inputStream); stream = inputStream; …

Member Avatar for vinithktp
0
897
Member Avatar for jobla6

To play a new game I do not have enough RAM. I am reluctant to pay to upgrade my RAM so I am considering increasing virtual memory instead. I only need to increase the memory by 1GB, but the point is basically is virtual memory suitable for playing games. A …

Member Avatar for tigerbright
0
211
Member Avatar for infantheartlyje

I have a base class and two derived class. One derived class which inherits base class as virtual and another one as non virtual. I have given below my codin. [CODE] // This program uses virtual base classes. #include <iostream> using namespace std; class base { public: int i; }; …

Member Avatar for Narue
0
201

The End.