Programming :: Manage Memory To Speed Up Program?

Nov 18, 2008

I wrote a program in lcc in windows and I have to write it in gcc in unix. In lcc there was an option to use more memory than the default for the stack. The following code is working in lcc but in gcc it gives segmentation fault:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
int main()
{

View 11 Replies


ADVERTISEMENT

Programming :: Data Structure To Manage Memory?

Oct 1, 2010

I have a mxn matric (which is my simplified way of saying it is RAM with bytes on it) Some of the locations on this metric is filled with some data and some places are empty. The mxn are very big numbers in size. I am trying to make a program so that if a system call wants to write some thing on empty locations on this mxn metric it should be able to do so without any problem. The thing which I want to understand or logic of a data structure is what data structure do you people feel should I be maintaining so that I can allocate the requested space immediately from the above mxn matric when some system call requests for some (k) number of locations from above metrics.

The logic initially I thought was to maintain a hashtable

1bytes requested----------> location 1,location 2,location 3.........location n
2bytes requested----------> location 1,location 2,location 3.........location n
3bytes requested----------> location 1,location 2,location 3.........location n

[code]....

but the problem with above logic is size of the pointers where I will be writing this problem is unsigned 64 byte.So to know location of one free byte if I am maintaining one pointer of type u64 this is not a feasible solution.

View 6 Replies View Related

Programming :: Small Java Program To Manage 2 Apartments?

Feb 17, 2011

this is my first post and I would like to get some help from you , so what should be the answer for this question ?:::::::::::::the question::::::::::::::::THE UNIVERSITY APARTMENTSThe University Apartments provides apartment rental to university students at affordable rates, with optional facilities:Apartment Type A, 2 bedrooms and equiped with kitchen and laundry facilities. The monthly rental for the rooms in this apartment type is RM300.Apartment Type B, 3 bedrooms includes one master bedroom with attached bathroom but does not have kitchen and laundry facilities. The monthly rental for the rooms in this apartment type is RM200 and students staying in the master bedroom will be paying an additional 40%.

Each apartment may house a maximum of 3 students. Students are required to check out from the apartment unit when the current semester ends.Create an application to manage the university apartments rental:1. Register new student and assign apartment moduleRegister and assigns an apartment to the student for 140 days from the date of registration. The module should retrieve the date automatically from the system clock and calculates the expiry date for the apartment rental. Before an apartment is assigned, the system should allow the selection of the type of apartment (i.e. Type A or B), then check for the number of occupants in the apartment. If the apartment already housed 3 students, it should recommend another apartment unit that is still available. Upon registration, student should pay a RM100 for the utility charges, rental deposit for one month and the rental for the current month.

2. Update apartment status moduleWhen a student moves out from an apartment, the apartment status is updated.3. Reporting moduleGenerates a report of apartments with full occupancy and another report for apartments where rooms are still available. 4. Search module Enable the administrator to search for a student's apartment unit using the student id as the search key. The search result should produce the student�s information and the details of the apartment that the student is staying in.The application should be developed using object-oriented concepts using Student class and Apartment class, implementing the appropriate data fields and methods for the classes. Data may be stored in collections i.e

View 10 Replies View Related

Programming :: Allocate Memory To A Program Before Execution?

Jan 3, 2011

I went to an interview last week and there was this guy who asked a simple question that i have been trying to solve for a couple of days. I tried google but i just cant get the search keywords right. The result were just useless. Well, the question is : "How can we allocate a limited memory to a process before we start its execution" well, the question is related to an X11 system so may be some flags must be set to limit its memory.

View 9 Replies View Related

Programming :: Possible To Know The Amount Of Memory Used By A Program Before Running It?

Mar 3, 2009

I would like to know if there is a linux command to verify the amount of memory used by a program. The programs I am using were compiled with gfortran.

View 2 Replies View Related

Programming :: Find Which Block Of Program Consume How Much Memory?

Apr 15, 2011

I am trying to run C++ program on linux.

My program consume a lot of memory so that the memory is used up fast and memory swap is very high.

I can find this by "ps" .

My program is long.

I need to find out which part of my program consume so much memory ?

View 1 Replies View Related

Programming :: Memory Corruption While Parsing In Multithread Program?

Aug 28, 2009

language: C
OS: linux

I wrote a multithread program(approx 1000 thread have to run) and each thread has to parse a file(for each thread there is one file, ex:thread1 has to parse file1 and thread2 has to parse file2 like this....). I wrote "parse" program as follows. It is working well, if i create 50 threads. but if i run more than 200 thraeds Im getting doublefree corruption as follows:

Code:

*** glibc detected *** ./simulator: double free or corruption (fasttop): 0xb70007b0 ***

And some time I am getting parsing problem and error af follows:

Code:

powersetting.6607:1: parser error : Start tag expected, '<' not found (where powersetting.6607 is file name, when i check this file it is started with '<').

parse program as follows:

Code:

void parse_first(char* filename, int portnum, struct Poweroff *Powerptr1)
{
struct Poweroff *Powerptr;
Powerptr = Powerptr1;

[code]....

View 1 Replies View Related

Debian Programming :: Memory Usage When Running Java Program

Jun 28, 2013

I have a java program that runs on Debian as a background processor. Yesterday the Java program stopped running. I looked at the memory usage, the system only had 5MB memory left, so my guess is that the java program ran out of memory to use.

However, after we restarted the java program, we could see that the free memory count started to go up. It kept going up from 5MB to over 400MB. The increase of memory happened slowly, when I measured it, I could see that with each minute passing by, there were a bit more memory added into the free memory pool, and meanwhile, the java background process was running.

I wonder why this would ever happen. It's as if our java program first brought the machine done because it consumed all the memories, then after restart, it starts to give back memories.

View 2 Replies View Related

Programming :: Quick Measurement Of Free System Memory From Within C Program

Jul 21, 2010

I need to monitor the amount of free physical memory on Linux from within a large C program. The sampling will occur very frequently, so the measurement cannot be performance intensive. The fact that Linux uses much of the theoretically free memory for cache and buffers means that just measuring the free pages is not sufficient. Using free + cache + buffers gives an overestimate as not all cache/buffers can be freed, but I could get a rough idea of how much generally can't and subtract that from the answer.

Possible options that I've come across so far are: Parsing /proc/meminfo - but that involves reading from file which is slow. Extracting the free, cache and buffers values from the output of the Free command - but is there a quick way to do this? Parsing the /proc/freemem file produced by the API here - but this is again reading from file. Is there a way to get that output directly? Speed is an extremely high priority, and the answer it must accurately represent the amount of memory that my program could expand into (to within a few Mb).

View 1 Replies View Related

Programming :: Vuse The Capacity Feature To Allocate All Memory At Beginning Of Program?

Jan 7, 2010

I have a vector that I do not want to call new on during operation so I use the Capacity Feature to allocate all memory at beginning of program

Code:
struct chartype
{
public:
unsigned char value[MAXCHARTYPE_SIZE];
};

[Code].....

View 2 Replies View Related

Ubuntu :: Manage Cpu Usage Per Program?

Aug 23, 2010

Looking for a way to control how much cpu apps are allowed to use. I'm 10.04 64bit dual core.

View 8 Replies View Related

OpenSUSE Wireless :: False Wireless Router Status While Steal Manage To Use The Internet At Full Speed

Feb 28, 2011

My wireless connection work just fine but it gives me wrong connection status, like 10% even when I'm seating near the wireless router or disconnect status while I steal manege to use the internet at full speed.

View 1 Replies View Related

General :: Automation - Good Console-based Program To Automatically Manage Music Collection?

May 31, 2011

I like the convenience of having a music player that manages the placement of my music files based on the tags of the files, sorting into a root music folder with Artist/Album/01 - Track Title.mp3 sort of hierarchy. Previously, I was using Banshee for this feature, as even most of the other gui music players don't have this library management feature. Now, I've been trying to use console-based applications, and I have been using mpd + ncmpcpp fairly successfully. When I download new music, it is downloaded to a specific folder, and that's not part of my music collection. My previous workflow would be to open a gui filemanager at the downloaded folder, and drag and drop those songs onto banshee, which would then make a copy of those files in my library hierarchy. Currently, I'm doing the same thing, using Banshee only as a sort of import program, then closing it and updating my mpd database, and there we go.

If at all possible, I'd like to automate this to something where I can define a watch folder, and when some magical program sees new music in said watch folder, it identifies the correct place for the files to be copied into my heirarchy, renaming folders and files to the correct format. I know I've written a lot describing, but I don't actually think this too uncommon a task, and I'm wondering if anyone has a solution for my problem.

View 3 Replies View Related

Programming :: Memory Leaks - Glibc Detected - ./SuffixTree: Malloc() - Memory Corruption - 0x00

Mar 21, 2011

I am new to C and linux. My code below does arbitary writes but I cant figure out where or how it does it.

I am calling the insertNode() function with seq = 'MISSISSPPI$' and alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ$'

Code:

Weird behaviour I should mention is that when I check for NULL pointer in node->child[index], the unassigned values are not null anymore, they point to arbitary memory.

View 12 Replies View Related

Programming :: Write A Script That Can Show Me Total Memory Vs Used Memory?

Apr 13, 2010

How do I write a script for my Linux that can show me total memory vs used memory and have it email me results if it's over 70 percent?

View 2 Replies View Related

Programming :: SHM Memory Counted As Cache Memory With Kernel 2.6.18?

Aug 25, 2010

Is that possible that SHM shared memory is counted as cache memory on Linux with kernel 2.6.18?If find it really odd since this memory is not file backed, but I have a piece of code that loads data using shm_open+mmap, and it generates an amount of cache memory in /proc/meminfo that corresponds exactly to the amount of shared memory (I load that data from a file but I am using posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED) to ensure this file is not cached and I made sure that it is working as expected). As far as I know SHM memory was not tagged as cache memory with kernel 2.6.9.If it is the case it is really unfortunate since normally cache memory can be considered to be part of the "available" memory since it can be flushed promptly but this is clearly not the case with SHM memory... Is there an easy way to get the total amount of used SHM memory on a system?

View 4 Replies View Related

Debian :: How Debian 5 Manage Physical Memory

Jan 1, 2011

i need some information about how Debian 5 manage the physical memory . such as the memory management algorithms. i have googled it a lot but i couldn't find it.

View 1 Replies View Related

Programming :: Connect To Sourceforge.net And Manage Files Trough Ftp?

Nov 30, 2010

seems that the secret way to manage sourceforge.net files without pain and blood is not revealed yet!I uploaded some files in my sourceforge project named blackwar .I want to connect to my projects folder in sourceforge.net using filezilla or gftp.I want to see my files there and manage them.

View 3 Replies View Related

OpenSUSE :: Getting A Fan Speed/temperature Monitoring Program For 11.4?

Mar 18, 2011

I have a dual boot with xp and opensuse 11.4. There has been an annoying 'system fan has failed' error message that was dealt with by replacing a fan and installing speedfan and hardware monitor on the windows partition, but my opensuse installation has no such programs running, and I want to keep things cool while I'm running opensuse. Speedfan is a program that tells the fans to turn on and off. Usually according to the temperature that the sensors are reading. The program shows temperatures and fan speeds and allows you to have control.Is there a fan speed/temperature monitoring program for opensuse?

View 7 Replies View Related

Ubuntu :: Find Program For Speed Download Like IDM In Windows

Jan 23, 2011

i want to find a program to help me for speed download like IDM in windows

View 2 Replies View Related

Networking :: Any Program To Limit Download Speed Per Connection?

Mar 29, 2011

I need a program that will limit download speed per connection. So that each download is limited to 100kbit/s for e,g. I tried trickled, it only limits whole application (and doesn't work with firefox). Also tried pyshaper, doesn't work. Is there such software?

View 1 Replies View Related

Ubuntu :: How To Allocate Memory To Program?

Nov 24, 2010

I am running BWA (burrow-wheeler alignment) and, keep getting an error that there isn't enough memory allocated. How do I change the memory allocation? I'm working on a good quality desktop only a little over a year old, so having the memory shouldn't be the problem.

View 9 Replies View Related

Ubuntu :: Record Memory Usage Of Program?

Jan 17, 2010

Is there a way I can start a program and then record a log of how much memory it's using at a specific interval until the program ends?

I've tried writing a shell script but get the error: ./apps/mem-test.sh: line 4: [: too many arguments

Here's the non-working script:

Code:
$HOME/apps/ImageMagick/bin/convert -limit memory 64 -limit map 128 $HOME/SSI/davidkennardphotography/Img-Orig/95-Pole-Bank.jpg -set option:filter:filter Lanczos -set option:filter:blur 0.8 -resize 1024x720 $HOME/resizedImage.jpg &
GOODY="ps -p $! -o pid,%cpu,rss,cmd | grep convert >>test.txt"

[Code]....

View 3 Replies View Related

General :: Memory Corruption Tool In A Program?

Oct 14, 2010

Kindly let me know the Linux tool to find out the memory corruption in a program. The tool could be built for PPC as well.

View 6 Replies View Related

General :: Program To View Data In Memory RAM?

Aug 5, 2011

I'm running a java program and to debug the program instead of using a debugger I would like to look to the heap and to the bytes in the memory of the process. I was hoping that the pointers would give me a snapshot of a moment of the application. It exists a program that allow us to look to the details of a process and to the memory ram?

View 2 Replies View Related

Ubuntu :: Program Convert Consumes Most Of The Computer's Memory

Oct 5, 2010

I am using ubuntu 10.10 with gnome desktop on a desktop computer (pentium 4 cpu with 1 Gb memory), and when I use OpenOffice Impress, convert opens up and uses most of my cpu power. Even worse, after closing OpenOffice and all instances of nautilus, convert stays in memory and keeps using most of my cpu power (between 30 and 75 %, acccording to system monitor.Is it normal ? How could I set up my computer to limit convert cpu usage, and to unload from memory after being used.

View 3 Replies View Related

General :: Find Total Memory Usage Of A Program?

Sep 22, 2010

I wrote a program that multiplies 2 matrices using multi-threads and another one using multiple processes and shared memory. Both in C.I need to find the total memory usage of these programs. I know of the top command, but when my matrices are relatively small they don't even show up on top because they complete so fast, how can I find the memory usage for these instances?Also, how can I find the total turnaround time of my programs?

View 3 Replies View Related

Software :: Program - Information On Drives Space Memory

Mar 5, 2010

A few years back when I was running Linux most of the time I used a program that gave me information on my machine.

It had different themes and such, and it would usually rest vertically along the side of the desktop. It would tell one information on drives, space, memory, I think you could even have it tell you the weather if you entered geographical information.

I know I'm being a bit vague but that's all I can remember, does anyone recall this program? It was pretty popular back then...so I wonder if it's still under development.

View 2 Replies View Related

Software :: Memory Card Data Recovery Program?

May 18, 2009

A friend of mine asked me to try and recover some photos she deleted by accident on her SD memory card. Normally, I would flip over to my Windows box and do this, but I'm wondering if there is a Linux equivalent to a Windows data recovery program. I'm running Fedora 10.

View 2 Replies View Related

Programming :: Program A SH - Bash Program With Zenity To Play Radio Based On A Site?

Feb 15, 2011

I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html

My code to get url's radio country.htm is:

Code:

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved