关于容器的处理,只是拿来用,理解不深,但是今天跑程序出了问题。释放空间未得到真正的释放。于是网上找了一些文章,解决的问题。解决方法:使用swap 加上clear,一起释放空间。原理:即先创建一个临时拷贝与原先的vector一致,值得注意的是,此时的拷贝(申请空间时系统分配容量)其容量是尽可能小的符合...
分类:
其他好文 时间:
2014-07-22 22:40:34
阅读次数:
145
1. make时遇到一个标志位不被支持,需要升级gcc: yum update gcc 2. make modules_install时提示137错误: 需要增大虚拟机内存或swap分区。 3. make install时提示: [root@mon1 linux-3.15.5]# make install s...
分类:
系统相关 时间:
2014-07-22 08:13:35
阅读次数:
414
list
----------------------------------------------------------------------
??为什么很多在算法库里有的算法还要在类的成员函数里重新实现一遍?
-->1.因为算法库里的是通用的,对于具体的类来说效率不高。
比如说 reverse 如果直接用 stl_algo.h 里的 reverse,会再调用 iter_swap,
而 iter_swap 的实现方法是借用临时变量来交换两个迭代器指向的元素,这样会调用
好几次构造函数、拷贝方法、析构...
分类:
其他好文 时间:
2014-07-22 00:27:35
阅读次数:
357
//algorithm.henum SWAP_TYPE{MEMORY, COMPLEX};struct SIntArray{ int *pData; int num; SIntArray():pData(NULL),num(0){} void Clear(){delete ...
分类:
其他好文 时间:
2014-07-21 09:38:33
阅读次数:
263
代码: 1 #include 2 3 void swap(int x,int y) 4 { 5 int temp; 6 7 temp = x; 8 x = y; 9 y = temp;10 printf("In swap: x = %d,y = ...
分类:
编程语言 时间:
2014-07-20 22:14:56
阅读次数:
255
#include
using namespace std;
int n=0;
template
void Swap(T *a,T *b)
{
T temp=*a;
*a=*b;
*b=temp;
}
template
void Perm(T A[],int k,int m)
{
if(k>m)
{
for(int i=0;i
{
cou...
分类:
其他好文 时间:
2014-07-20 00:12:42
阅读次数:
250
Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2-...
分类:
其他好文 时间:
2014-07-19 22:25:10
阅读次数:
210
It is often useful to swap the values of two variables. With conventional assignments, you have to use a temporary variable. This solution is cumberso...
分类:
其他好文 时间:
2014-07-19 18:32:06
阅读次数:
243
大并发连接的oracle在Linux下内存不足的问题的分析2010-01-28 20:06:21分类:Oracle最近一台装有Rhel5.3的40G内存的机器上有一个oracle数据库,数据库的SGA设置为20G,当运行业务时,一个业务高峰期时,发现swap频繁交换,CPU 100%,Load很高,...
分类:
数据库 时间:
2014-07-19 14:38:57
阅读次数:
325
一、交换分区:swap目前几乎所有的操作系统都是多任务多用户的,且使用了MMU完成了内存保护,以使得多进程得以完成。如此一来,每个进程都有自己的线性地址空间,其中的数据会被映射到物理地址空间中。第一个进程使用第一个线性地址空间,第二个进程使用第二个线性地址空间,依..
分类:
其他好文 时间:
2014-07-19 02:26:36
阅读次数:
485