03-11-2015
How to decrease virtual size of a process after cleaning all containers and using malloc_trim (0)?
Hello all
i have simple server running on linux redhat 6.1
it is build with c++
in the server i have huge std vector that holds pointers to cache objects
those cache objects holds allot of data from the DB
any way ...
in some point in time there is simple API that suppose to clean the vector
i do simple iteration over the std vector and delete the object pointers and in the end i also clean() the vector
and after all of this i execute : malloc_trim (0) that returns 1
the problem is that the virtual size of a process never decrease
BUT only the resident size do decrease fine .
the big problem when i like to load the cache again , the virtual size of a process get doubled .
how do i decrease virtual size of a process in c++/c ?
thanks
10 More Discussions You Might Find Interesting
1. Programming
using namespace std;
void g();
class A {
public :
A() { g();g();g(); cout << "Constructor of A"<< endl ;}
};
inline void g(){ cout << "vijay" <<endl; }
int main() {
A a;
}
when i use inline i get size 303488 Aug 31 12:05 a.out*
when not using inline i get size 303572 Aug 31... (1 Reply)
Discussion started by: vijaysabari
1 Replies
2. UNIX for Dummies Questions & Answers
Hello all
im using the ps -ef "args vsz" | some.exe
but the result is in kb , is there some kind of way or flag ( didnt found in the ps man )
to convert me this data to GB or MG in human readable format ?
Thanks (1 Reply)
Discussion started by: umen
1 Replies
3. UNIX for Dummies Questions & Answers
how to decrease priority of a particular process in time of process creation...
and also how to decrease priority of a particular process after process creation..
can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies
4. Shell Programming and Scripting
Hi all,
I am using
echo "$EMAILMESSAGE" | mailx -s "$SUBJECT" -b $CC "$TO"
I am receiving the mail but seems to big in font size. Is there any option mailx to decrease the size of the mail generated.
Thanks, (1 Reply)
Discussion started by: shellscripter
1 Replies
5. Programming
Hi,
I am looking to work on unix systems which include (hp-ux, ibm aix, solaris and linux). I want to get the total virtual address space of a process, the used virtual memory i am able to get without any problem. I have tried using getrlimit and getrlimit64, but that gives only ... (4 Replies)
Discussion started by: uiqbal
4 Replies
6. UNIX for Advanced & Expert Users
Hello all,
To do a self-exec or self-restart of a process when it crosses the threshold memory limit, I use the value of virtual memory size field from /proc/$pid/stat file and do a self-exec.
According to man 5 proc
vsize %lu
Virtual memory size in bytes.
I just want to... (2 Replies)
Discussion started by: matrixmadhan
2 Replies
7. AIX
Hi
I have found a problem on my AIX 5.1 server. day by day the paging size is increasing,what is the reason behind it and if percentage is at 100 what will happen. Oracle 9i is running on my server.
PAGING SPACE
size,mb 5632
% used 14.6
% free 85.3
How can i decrease the using... (6 Replies)
Discussion started by: dearsumon
6 Replies
8. Fedora
I m tring to figure out the option where i can increase/Decrease the count for local virtual consoles(vtys).
I can able to take upto 6 vtys using (left alt+(F1-F6))
But is there any way i can increase the count ?
One more query
even though i can only take tty upto tty6 why there are tty... (2 Replies)
Discussion started by: pinga123
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am using the below command to get the output in a file called "Logs.txt"
tail -f filename | egrep -i "cpu | hung " >> Logs.txt The problem is the Logs.txt file gets updated only after the buffer is 8Kb, but i want to update the file immediately and not wait for the buffer to get 8kb.
Is... (8 Replies)
Discussion started by: @bhi
8 Replies
10. AIX
Hello,
I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command.
My AIX system is version 6.1 and the filesystem... (2 Replies)
Discussion started by: Phat
2 Replies
LEARN ABOUT LINUX
kmem_cache_create
KMEM_CACHE_CREATE(9) Memory Management in Linux KMEM_CACHE_CREATE(9)
NAME
kmem_cache_create - Create a cache.
SYNOPSIS
struct kmem_cache * kmem_cache_create(const char * name, size_t size, size_t align, unsigned long flags, void (*ctor) (void *));
ARGUMENTS
name
A string which is used in /proc/slabinfo to identify this cache.
size
The size of objects to be created in this cache.
align
The required alignment for the objects.
flags
SLAB flags
ctor
A constructor for the objects.
DESCRIPTION
Returns a ptr to the cache on success, NULL on failure. Cannot be called within a int, but can be interrupted. The ctor is run when new
pages are allocated by the cache.
name must be valid until the cache is destroyed. This implies that the module calling this has to destroy the cache before getting
unloaded. Note that kmem_cache_name is not guaranteed to return the same pointer, therefore applications must manage it themselves.
The flags are
SLAB_POISON - Poison the slab with a known test pattern (a5a5a5a5) to catch references to uninitialised memory.
SLAB_RED_ZONE - Insert `Red' zones around the allocated memory to check for buffer overruns.
SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware cacheline. This can be beneficial if you're counting cycles as closely
as davem.
COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 KMEM_CACHE_CREATE(9)