fragmentation

Calculating memory fragmentation in Python

烂漫一生 提交于 2021-01-27 06:36:22
问题 I have a long running process that allocates and releases objects constantly. Although objects are being freed, the RSS mem usage goes up over time. How can I calculate how much fragmentation is happening? One possibility is to calculate RSS / sum_of_allocations and take that as an indicator. even then, how to do I calculate the denominator (sum_of_allocations). 回答1: Check out the Garbage Collector interface, gc. http://docs.python.org/2/library/gc.html You can inspect the objects are being

Out of memory error android due to fragmentation after 20+days

北战南征 提交于 2020-08-08 06:19:10
问题 I made a application that runs on a coffee machine. After 20+ days (can be 60+ days depending on use) an OutOfMemoryError occurs: java.lang.OutOfMemoryError: Failed to allocate a 604 byte allocation with 16777216 free bytes and 319MB until OOM; failed due to fragmentation (required continguous free 65536 bytes for a new buffer where largest contiguous free 53248 bytes) My question is: Is there a way to run a defragmentation on memory android application programmatically? The time it takes

packet fragmentation for raw sockets

我的未来我决定 提交于 2020-01-01 16:32:17
问题 If I am using raw sockets to send a UDP packet of size 3000bytes, do I need to handle packet fragmentation myself in the code, or should the raw socket handle fragmentation similar to DGRAM socket? 回答1: Well, if you are using UDP, you aren't really sending RAW. RAW would be no IP at all, in which case yes you have to handle fragmentation yourself. With UDP you get IP's fragmentation support, which is IMHO plenty good enough for short-haul networks where collisions should be minimal. Make the

Why and when is necessary to rebuild indexes in MongoDB?

拜拜、爱过 提交于 2019-12-31 17:58:43
问题 Been working with MongoDB for a while and today I had a doubt while discussing with a colleague. The thing is that when you create an index in MongoDB, the collection is processed and the index is built. The index is updated within insertion and deletion of documents so I don't really see the need to run a rebuild index operation (which drops the index and then rebuild it). According to MongoDB documentation: Normally, MongoDB compacts indexes during routine updates. For most users, the

How can I limit file fragmentation while working with .NET?

房东的猫 提交于 2019-12-29 07:57:09
问题 In my application I am gathering small data bits into a bigger file over time. As a result, the target file becomes excessively fragmented. What can be done to limit fragmentation of the output file with .NET? 回答1: You could deliberately increment the file size in larger chunks and internally monitor where the end of your current usage is. That way you give the system a better chance of allocating contiguous space for your file. 回答2: The only way you can reliably reduce file fragmentation is

TCP/UDP and ethernet MTU Fragmentation

拜拜、爱过 提交于 2019-12-21 05:36:07
问题 I've read various sites and tutorials online but I am still confused. If the message is bigger than IP MTU, then send() returns the byte sent. What happens to the rest of the message? Am I to call send() again and attempt to send rest of the message? Or is that something IP layer should take care of automatically? 回答1: If you are using TCP then the interface presented to you is that of a stream of bytes. You don't need to worry about how the stream of bytes gets from one end of the connection

TCP messages getting coalesced

霸气de小男生 提交于 2019-12-11 10:54:12
问题 I have a Java application that is writing to the network. It is writing messages in the region of 764b, +/- 5b. A pcap shows that the stream is getting IP fragmented and we can't explain this. Linux 2.6.18-238.1.1.el5 A strace shows: ( strace -vvvv -f -tt -o strace.out -e trace=network -p $PID ) 1: 2045 12:48:23.984173 sendto(45, "\0\0\0\0\0\0\2\374\0\0\0\0\0\3\n\0\0\0\0\3upd\365myData"..., 764, 0, NULL, 0) = 764 2: 15206 12:48:23.984706 sendto(131, "\0\0\0\0\0\0\2\374\0\0\0\0\0\3\n\0\0\0\0

Zoom controls on emulator running Android 1.6 with QVGA

北慕城南 提交于 2019-12-10 23:39:28
问题 I'm testing my app on different AVD setups in the emulator and ran into problems with zoom controls in MapView on Android 1.6 using QVGA resolution only (lcd.density=120). When tapping on the screen so the zoom controls are displayed, the zoom in/plus sign is displayed much larger than zoom out, which seem to have the correct resolution. I've tested different combination of Android versions and resolutions but only 1.6 with QVGA resolution seem to be having this issue. I've searched on Google

“Out of memory” error for standalone matlab applications - memory fragmentation

时光怂恿深爱的人放手 提交于 2019-12-10 22:02:25
问题 I have to deliver an application as a standalone Matlab executable to a client. The code include a series of calls to a function that internally creates several cell arrays. My problem is that an out-of-memory error happens when the number of calls to this function increases in response to the increase in the user load. I guess this is low-level memory fragmentation as the workspace variables are independent from the number of loops. As mentioned here, quitting and restarting Matlab is the