Search Results

Search found 12267 results on 491 pages for 'out of memory'.

Page 191/491 | < Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >

  • Accidental Complexity in OpenSSL HMAC functions

    - by Hassan Syed
    SSL Documentation Analaysis This question is pertaining the usage of the HMAC routines in OpenSSL. Since Openssl documentation is a tad on the weak side in certain areas, profiling has revealed that using the: unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, int n, unsigned char *md, unsigned int *md_len); From here, shows 40% of my library runtime is devoted to creating and taking down **HMAC_CTX's behind the scenes. There are also two additional function to create and destroy a HMAC_CTX explicetly: HMAC_CTX_init() initialises a HMAC_CTX before first use. It must be called. HMAC_CTX_cleanup() erases the key and other data from the HMAC_CTX and releases any associated resources. It must be called when an HMAC_CTX is no longer required. These two function calls are prefixed with: The following functions may be used if the message is not completely stored in memory My data fits entirely in memory, so I choose the HMAC function -- the one whose signature is shown above. The context, as described by the man page, is made use of by using the following two functions: HMAC_Update() can be called repeatedly with chunks of the message to be authenticated (len bytes at data). HMAC_Final() places the message authentication code in md, which must have space for the hash function output. The Scope of the Application My application generates a authentic (HMAC, which is also used a nonce), CBC-BF encrypted protocol buffer string. The code will be interfaced with various web-servers and frameworks Windows / Linux as OS, nginx, Apache and IIS as webservers and Python / .NET and C++ web-server filters. The description above should clarify that the library needs to be thread safe, and potentially have resumeable processing state -- i.e., lightweight threads sharing a OS thread (which might leave thread local memory out of the picture). The Question How do I get rid of the 40% overhead on each invocation in a (1) thread-safe / (2) resume-able state way ? (2) is optional since I have all of the source-data present in one go, and can make sure a digest is created in place without relinquishing control of the thread mid-digest-creation. So, (1) can probably be done using thread local memory -- but how do I resuse the CTX's ? does the HMAC_final() call make the CTX reusable ?. (2) optional: in this case I would have to create a pool of CTX's. (3) how does the HMAC function do this ? does it create a CTX in the scope of the function call and destroy it ? Psuedocode and commentary will be useful.

    Read the article

  • do I need to close an audio Clip?

    - by Michael
    have an application that processes real-time data and is supposed to beep when a certain event occurs. The triggering event can occur multiple times per second, and if the beep is already playing when another event triggers the code is just supposed to ignore it (as opposed to interrupting the current beep and starting a new one). Here is the basic code: Clip clickClip public void prepareProcess() { super.prepareProcess(); clickClip = null; try { clipFile = new File("C:/WINDOWS/Media/CHIMES.wav"); ais = AudioSystem.getAudioInputStream(clipFile); clickClip = AudioSystem.getClip(); clickClip.open(ais); fileIsLoaded = true; } catch (Exception ex) { clickClip = null; fileIsLoaded = false; } } public void playSound() { if (fileIsLoaded) { if ((clickClip==null) || (!clickClip.isRunning())) { try { clickClip.setFramePosition(0); clickClip.start(); } catch (Exception ex) { System.out.println("Cannot play click noise"); ex.printStackTrace(); } } } The prepareProcess method gets run once in the beginning, and the playSound method is called every time a triggering event occurs. My question is: do I need to close the clickClip object? I know I could add an actionListener to monitor for a Stop event, but since the event occurs so frequently I'm worried the extra processing is going to slow down the real-time data collection. The code seems to run fine, but my worry is memory leaks. The code above is based on an example I found while searching the net, but the example used an actionListener to close the Clip specifically "to eliminate memory leaks that would occur when the stop method wasn't implemented". My program is intended to run for hours so any memory leaks I have will cause problems. I'll be honest: I have no idea how to verify whether or not I've got a problem. I'm using Netbeans, and running the memory profiler just gave me a huge list of things that I don't know how to read. This is supposed to be the simple part of the program, and I'm spending hours on it. Any help would be greatly appreciated! Michael

    Read the article

  • gcc segmentation fault compiling 20k file

    - by aaa
    hi. I have fairly large file, 20k lines long (auto generated). It has been compiling okay, but after adding new if/endif preprocessor block, I started getting gcc internal errors: segmentation fault. the code inside new preprocessor block is not being compiled, so I am not sure where the error is coming from. my only guess is memory, but as far as I can tell it does not exhaust computer memory. Any thoughts?

    Read the article

  • Sound Manager Classes for Windows

    - by Yakov
    I need some classes for playing short wav sounds, this classes would load this wav files into memory when an instance created, play sounds in background when needed, release this wav files from memory when an instance disposed. How can I do this on C# for windows (.Net 2.0)? (Win API's sndPlaySound, OpenAL or may be any wrapper) Ideally I would love to find an exist solution that simple and able to solve my task. Do you know any solutions for this issue?

    Read the article

  • Integer overflow exploitable?

    - by wuntee
    Does anyone have a detailed explanation on how integers can be exploited? I have been reading a lot about the concept, and I understand what an it is, and I understand buffer overflows, but I dont understand how one could modify memory reliably, or in a way to modify application flow, by making an integer larger than its defined memory....

    Read the article

  • dll process in system?

    - by Rajakumar
    hi ,i have a doubt in dlls loading &processing in memory ,normally dlls are shared library so dll should loads once is enough.if a process loads a dll (ex.advapi32.dll )into memory means ,after that another process how refers advapi32.dll to that process ...how can share common location for each process...

    Read the article

  • Why reduce the size of the Java JVM thread stack?

    - by djangofan
    I was reading an article on handling Out Of Memory error conditions in Java (and on JBoss platform) and I saw this suggestion to reduce the size of the threadstack. Can anyone explain how "reducing" the size of threadstack will help with a max memory error condition? http://community.jboss.org/wiki/OutOfMemoryExceptions

    Read the article

  • Outof memeory error in java

    - by anil
    hi we are getting out of memory exception for one of our process which is running in unix environmnet . how to identify the bug (we observed that there is very little chance of memory leaks in our java process). so whatelse we need analyse to find the rootcauase

    Read the article

  • Avoid having a huge collection of ids by calling a DAO.getAll()

    - by Michael Bavin
    Instead of returning a List<Long> of ids when calling PersonDao.getAll() we wanted not to have an entire collection of ids in memory. Seems like returning a org.springframework.jdbc.support.rowset.SqlRowSet and iterate over this rowset would not hold every object in memory. The only problem here is i cannot cast this row to my entity. Is there a better way for this?

    Read the article

  • new operator in DllMain of MFC Extension Dll

    - by Picaro De Vosio
    Hi, Dll best practices document from Microsoft available Here recommends avoiding use of memory management function from the dynamic C Run-Time (CRT) within DllMain. But DllMain function of MFC Extension DLL is dynamically allocating the memory for CDynLinkLibrary in the code snippet available at MSDN "http://msdn.microsoft.com/en-us/library/1btd5ea3%28v=VS.80%29.aspx". Is it a violation of Dll Best Practices or ok to use in MFC extension DLL? thanks

    Read the article

  • will mmap use user cpu instead of whole sys cpu? (solaris)

    - by Daniel
    when use mmap to allocate some anonymous mem, we often set the start address as 0/null so mmap will figure out the starting address by itself. And to get the start address, it will work thought the whole virtual memory space to find a hole which could put the chuck of mem to be allocated. I guess this is calculated as user cpu instead of sys cpu. If the virtual memory is fragmented, then the time to find the starting address will use more user cpu, is my understanding correct

    Read the article

  • Visual Studio - how to find source of heap corruption errors

    - by Danne
    Hi, I wonder if there is a good way to find the source code that causes a heap corruption error, given the memory address of the of the data that was written 'outside' the allocated heap block in Visual Studio; Dedicated (0008) free list element 26F7F670 is wrong size (dead) (Trying to write down some notes on how to find memory errors) Thanks in advance!

    Read the article

  • How to write a spinlock without using CAS

    - by Martin
    Following on from a discussion which got going in the comments of this question. How would one go about writing a Spinlock without CAS operations? As the other question states: The memory ordering model is such that writes will be atomic (if two concurrent threads write a memory location at the same time, the result will be one or the other). The platform will not support atomic compare-and-set operations.

    Read the article

  • Referencing global variables in local scopes

    - by Jineesh
    Hello, I would like to know memory leak in the below mentioned code. Does JavaScript do automatic garbage collection. var aGlobalObject = SomeGlobalObject; function myFunction() { var localVar = aGlobalObject; } Do I have to clear the memory as given below. var aGlobalObject = SomeGlobalObject; function myFunction() { var localVar = aGlobalObject; localVar = null;// or delete localVar } Thanks

    Read the article

  • With ARC why use @properties anymore?

    - by trapper
    In non-ARC code retained properties handily take care of memory management for you using the self.property = syntax, so we were taught to use them for practically everything. But now with ARC this memory management is no longer an issue, so does the reason for using properties evaporate? is there still any good reason (obviously other than providing public access to instance variables) to use properties anymore?

    Read the article

  • writing large excel spreadsheets

    - by pstanton
    has anybody found a library that works well with large spreadsheets? I've tried apache's POI but it fails miserably working with large files - both reading and writing. It uses massive amounts of memory leaving you needing a supercomputer to parse or create a 20+mb spreadsheet. Surely there is a more memory efficient way and someone has written it?!

    Read the article

  • Function allocation

    - by novice_coder
    Where are functions stored in a C++ program? For example int abc() { //where am I stored? } I know that we can take the address of a function, that means functions are stored somewhere in memory. But I have already read at many places that no memory allocation for functions takes place. I am confused. My question may seem vague to many of you but I can't help.

    Read the article

  • Load large images into Bitmap?

    - by GuyNoir
    I'm trying to make a basic application that displays an image from the camera, but I when I try to load the .jpg in from the sdcard with BitmapFactory.decodeFile, it returns null. It doesn't give an out of memory error which I find strange, but the exact same code works fine on smaller images. How does the generic gallery display huge pictures from the camera with so little memory?

    Read the article

  • Why does GC not clear the Dialog references?

    - by Pavel
    I have a dialog. Every time I create it and then dispose, it stays in memory. It seems to be a memory leak somewhere, but I can't figure it out. Do you have any ideas? See the screenshot of heap dump for more information. Thanks in advance. http://img441.imageshack.us/img441/5764/leak.png

    Read the article

  • c - difficulties with bit operations

    - by hatorade
    I'm debugging a program with GDB. unsigned int example = ~0; gives me: (gdb) x/4bt example 0xffd99788: 10101000 10010111 11011001 11111111 why is this not all 1's? i defined it as ~0... then the next line of code is: example>>=(31); and GDB gives me this when I try to examine the memory at bits: (gdb) x/4bt example 0xffffffff: Cannot access memory at address 0xffffffff what is going on???

    Read the article

< Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >