Search Results

Search found 16731 results on 670 pages for 'memory limit'.

Page 111/670 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • Thread safety with heap-allocated memory

    - by incrediman
    I was reading this: http://en.wikipedia.org/wiki/Thread_safety Is the following function thread-safe? void foo(int y){ int * x = new int[50]; /*...do some stuff with the allocated memory...*/ delete x; } In the article it says that to be thread-safe you can only use variables from the stack. Really? Why? Wouldn't subsequent calls of the above function allocate memory elsewhere?

    Read the article

  • How can I limit user bandwidth usage?

    - by Scarface
    Ok, I have a site, and it serves all images and mp3s through a php script and can be controlled and limited, but I am now worried about overall bandwidth of my site. For example, what if someone just sends a million requests to one of my pages? Does anyone have any suggestions into server methods used to prevent this? Should I use mod_cband http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling_p2?

    Read the article

  • Custom punctuation function making script run over the php's 60s runtime limit

    - by webmasters
    I am importing allot of product data from an XML file (about 5000 products). When I run the script I can make it work in about 10-12 seconds. Now, when I add this punctuation function which makes sure each product description ends with a punctuation sign, the code runs until the php 60 seconds loadtime on my server but I'm not getting any errors. I have error reporting turned on. I just get a final error that the script could not load in 60 seconds. The question is, looking at this function, is it that resource consuming? What can I do to make it faster? function punctuation($string){ if(strlen($string) > 5){ // Get $last_char $desired_punctuation = array(".",",","?","!"); $last_char = substr($string, -1); // Check if $last_char is in the $desired_punctuation array if(!in_array($last_char, $desired_punctuation)){ // strip the $mytrim string and get only letters at the end; while(!preg_match("/^[a-zA-Z]$/", $last_char)){ $string = substr($string, 0, -1); $last_char = substr($string, -1); } // add "." to the string $string .= '.'; } } return $string; } If the function is ok, the long runtime must come from something else which I'll have to discover. I just want your input on this part.

    Read the article

  • Can I get memory usage of processes running on the monitored server by newrelic REST API

    - by youlin
    according to the newrelic faq https://docs.newrelic.com/docs/server/server-monitor-faq, The Server Monitoring agent can report Top 20 processes that are using significant memory or I/O and I can view the memory usage of the processes on the newrelic portal page. However, I do not find any clue about how to get this metrics by newrelic REST API (I can get the CPU usage of processes by REST API). Is it possible to do this?

    Read the article

  • returning aligned memory with new?

    - by Steve
    I currently allocate my memory for arrays using the MS specific mm_malloc. I align the memory, as I'm doing some heavy duty math and the vectorization takes advantage of the alignment. I was wondering if anyone knows how to overload the new operator to do the same thing, as I feel dirty malloc'ing everywhere (and would eventually like to also compile on Linux)? Thanks for any help

    Read the article

  • how to get around the command line length limit

    - by Crash893
    I've been working on a small and simple program that i drop files onto and based on certian rules they are moved to diffrent places. the program works fine unless i drop more than a few files on the program then it kicks back an error (that appears to be more windows than anything) that the start up command c:\myapp.exe \file \file \file is to long I realize i could set up a background proccess but i really would prefer that this program not run in the backround (where it would be idle 99.999999999% of the time) Can anyone think of any way around this limitation?

    Read the article

  • Break the limit of threading, segmentation fault

    - by user353573
    use pthread_create to create limited number of threads running concurrently Successfully compile and run However, after adding function pointer array to run the function, Segmentation fault Where is wrong? workserver number: 0 Segmentation fault void* workserver(void arg) { int status; while(true) { printf("workserver number: %d\n", (int)arg); ( job_queue[(int)arg])(); sleep(3); status = pthread_mutex_lock(&data.mutex); if(status != 0) printf("%d lock mutex", status); data.value = 1; status = pthread_cond_signal(&data.cond); if(status != 0) printf("%d signal condition", status); status = pthread_mutex_unlock(&data.mutex); if(status != 0) printf("%d unlock mutex", status); } }

    Read the article

  • Where are global variables stored in memory?

    - by Jack
    Are they stored in the heap or there is separate area where they are stored? Similarly where are static variables stored in memory. They can't be stored in frames as they will get destroyed when the function returns. PS - Can someone suggest a good book that talks about memory mapping for C/C++.

    Read the article

  • Memory Regions displayed in SMAPS output with no permissions

    - by crissangel
    If I see the output of cat /proc//smaps, I find that there are some memory regions with which no read/write/execute permissions have been associated. Also these region are mapped to inode number 0. I wanted to know how does a region end up in such a state? Is it some sort of memory leak? Can these regions be ever used again by the process?

    Read the article

  • [MySQL Query] How to limit date?

    - by rasouza
    I'd like to select all entries from a table where date is the last one and only those ones. For example: today is May 16th, the last entries I have from my table is dated from May 15th, but I have older ones (May 14th, May13th, etc). I'd like to select only the dated from May 15th, but it's not this specific date, I need to select every entry dated from the last date I have in my database. How to? Thx in advance

    Read the article

  • How to copy the memeory allocated in device function back to main memory

    - by xhe8
    I have a CUDA program containing a host function and a device function Execute(). In the host function, I allocate a global memory output which will then be passed to the device function and used to store the address of the global memory allocated within the device function. I want to access the in-kernel allocated memory in the host function. The following is the code: #include <stdio.h> typedef struct { int * p; int num; } Structure_A; \__global__ void Execute(Structure_A *output); int main(){ Structure_A *output; cudaMalloc((void***)&output,sizeof(Structure_A)*1); dim3 dimBlockExecute(1,1); dim3 dimGridExecute(1,1); Execute<<<dimGridExecute,dimBlockExecute>>>(output); Structure_A * output_cpu; int * p_cpu; cudaError_t err; output_cpu= (Structure_A*)malloc(1); err=cudaMemcpy(output_cpu,output,sizeof(Structure_A),cudaMemcpyDeviceToHost); if( err != cudaSuccess) { printf("CUDA error a: %s\n", cudaGetErrorString(err)); exit(-1); } p_cpu=(int *)malloc(1); err=cudaMemcpy(p_cpu,output_cpu[0].p,sizeof(int),cudaMemcpyDeviceToHost); if( err != cudaSuccess) { printf("CUDA error b: %s\n", cudaGetErrorString(err)); exit(-1); } printf("output=(%d,%d)\n",output_cpu[0].num,p_cpu[0]); return 0; } \__global__ void Execute(Structure_A *output){ int thid=threadIdx.x; output[thid].p= (int*)malloc(thid+1); output[thid].num=(thid+1); output[thid].p[0]=5; } I can compile the program. But when I run it, I got a error showing that there is a invalid argument in the following memory copy function. "err=cudaMemcpy(p_cpu,output_cpu[0].p,sizeof(int),cudaMemcpyDeviceToHost);" CUDA version is 4.2. CUDA card: Tesla C2075 OS: x86_64 GNU/Linux

    Read the article

  • Jquery to limit the range of input

    - by Sharvari
    I have a text box that takes input as amount..I want to prevent the user from entering Amount greater than a certain amount..I tried using ajax ..but its not working the way i want..I think jquery wud do the needful..but I am not so good at it..If any one can help?? Ajax function that i Have written: function maxIssue(max, input, iid) { var req = getXMLHTTP(); var strURL = "limit_input.php?max=" + max + "&iid=" + iid; if (input > max) { alert("Issue Failed.Quantity Present in Stock is " + max); } if (input < 0) { alert("Issue Failed.Enter positive Value"); } if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('maxdiv').innerHTML = req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } } req.open("GET", strURL, true); req.send(null); }

    Read the article

  • Setting up Tomcat6 properly in Ubuntu 10.04

    - by aasukisuki
    We have a Tomcat6 instance running on Ubuntu 10.04LTS. Our test box was just a Windows machine running Tomcat6. Both machines (Linux and Windows) have 1GB of ram. Via the Tomcat configuration tool in windows, I was able to set the min/max/permgen sizes of the JVM. Those were set to 256/512/128 respectively. Now on the Ubuntu box, I've tried setting the JVM options in several different places including: Adding JAVA_OPTS & CATALINA_OPTS in /etc/environment Adding JAVA_OPTS in $CATALINA_HOME/bin/catalina.sh Creating setenv.sh and adding JAVA_OPTS in $CATALINA_HOME/bin Adding JAVA_OPTS directly to /etc/init.d/tomcat6 Un-commenting the JAVA_OPTS and modifying it in /etc/default/tomcat6 Nearly all of those methods did not work, except for modifying /etc/init.d/tomcat6 directly (and possibly the /etc/default/tomcat6 change, but I just did that). However, my understanding is that when you change these settings, only one JVM should be used for the entire tomcat6 instance, and that memory is shared among the applications. On our windows box, tomcat6 is run as a service, and appears to behave this way. However, when I look at htop on the linux box, there are 20+ tomcat6 instances (I have an app that triggers internal jobs every X seconds using chron, so maybe these are threads? Or are they actual instances) all with those memory settings. The app runs fine for a bit, but eventually ends up locking up. I'm guessing each of these apps thinks it has 512m to work with and never GC's and then locks tomcat up completely. What is the proper way to set all of this up?

    Read the article

  • Why is usable RAM less than total RAM?

    - by D Connors
    My girlfriend bought a laptop last week. It's a core 2 duo with 4 GB We installed vista 64bit, and one of the first things we did was right click on "My computer" to see gthe properties. Immediately we noticed something strange about her RAM, the line said: Installed memory (RAM): 4,00 GB (3,68 GB usable) I told her not to worry, thinking it must be something about the laptop hardware (considering her vista installation came from the same DVD as mine, and I never noticed anything like that on my 4 GB desktop). One hour ago, it got worse. We looked at Properties again, and it now says: Installed memory (RAM): 4,00 GB (2,98 GB usable) What does that mean? Are those 1,02 GB missing or being used by the system? EDIT: There is a possibility that the sytem information is wrong. I just noticed that it reports an intel T6500 processor, when it's actually a T6400. How can I find out how much RAM is really available to the system? EDIT2: Checking the resource monitors, it says 1003 MB are reserved for the hardware. Is that good or bad? Thanks

    Read the article

  • Is it necessary to burn-in RAM for server-class systems?

    - by ewwhite
    When using server-class systems with ECC RAM, is it necessary or even useful to burn-in the memory DIMMs prior to deployment? I've encountered an environment where all server RAM is placed through a lengthy multi-day burn-in/stress-tesing process. This has delayed system deployments on occasion and adds an extra step to the hardware lead-time. The server hardware is primarily Supermicro, so the RAM is sourced from a variety of vendors; not directly from the manufacturer like a Dell Poweredge or HP ProLiant. Is this process useful? In my past experience, I simply used vendor RAM out of the box. Isn't that what the POST memory tests are for? I've encountered and responded to ECC errors long before a DIMM actually failed. The ECC thresholds were usually the trigger for warranty placement. Do you burn your RAM in? If so, what method do you use to perform the tests? Has the burn-in process resulted in any additional platform stability? Has it identified any pre-deployment problems?

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >