Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
0ab4db45
Commit
0ab4db45
authored
Jan 24, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_memory
parent
2b44d793
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
final_load_low_memory.cc
debug/final_load_low_memory.cc
+3
-2
test_memory.cc
debug/test_memory.cc
+61
-0
No files found.
debug/final_load_low_memory.cc
View file @
0ab4db45
...
...
@@ -144,7 +144,8 @@ void initGfb(std::vector<FieldMetaTrans> &res,std::string db,std::string table){
}
tupleNum
=
column
.
size
();
gfb
.
annoOnionNameToFileVector
[
gfb
.
field_names
[
i
]]
=
std
::
move
(
column
);
}
}
//get memory 31%
//init another map
for
(
unsigned
int
i
=
0
;
i
<
gfb
.
field_names
.
size
();
i
++
){
gfb
.
annoOnionNameToType
[
gfb
.
field_names
[
i
]]
=
gfb
.
field_types
[
i
];
...
...
@@ -169,7 +170,7 @@ void initGfb(std::vector<FieldMetaTrans> &res,std::string db,std::string table){
}
}
gfb
.
annoOnionNameToFileVector
.
erase
(
gfb
.
field_names
[
i
]);
}
}
//here we get memory 100% and segment fault
}
static
...
...
debug/test_memory.cc
0 → 100644
View file @
0ab4db45
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <map>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include "wrapper/reuse.hh"
#include "wrapper/common.hh"
#include "wrapper/insert_lib.hh"
using
std
::
cout
;
using
std
::
cin
;
using
std
::
endl
;
using
std
::
vector
;
using
std
::
string
;
using
std
::
to_string
;
static
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
gfm
;
/*init global full backup. */
static
void
initGfb
(
vector
<
string
>
field_names
,
vector
<
int
>
field_types
,
vector
<
int
>
field_lengths
,
std
::
string
db
,
std
::
string
table
){
std
::
string
prefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
"/"
;
for
(
unsigned
int
i
=
0u
;
i
<
field_names
.
size
();
i
++
)
{
std
::
string
filename
=
prefix
+
field_names
[
i
];
std
::
vector
<
std
::
string
>
column
;
if
(
IS_NUM
(
field_types
[
i
])){
load_num_file
(
filename
,
column
);
}
else
{
load_string_file
(
filename
,
column
,
field_lengths
[
i
]);
}
gfm
[
field_names
[
i
]]
=
std
::
move
(
column
);
}
//get memory 31%
for
(
unsigned
int
i
=
0u
;
i
<
field_names
.
size
();
i
++
)
{
gfm
.
erase
(
field_names
[
i
]);
}
return
;
}
int
main
(
int
argc
,
char
*
argv
[]){
vector
<
int
>
lengths
{
20
,
15
,
256
,
11
};
vector
<
int
>
types
{
8
,
8
,
253
,
8
};
std
::
vector
<
std
::
string
>
names
{
"BLWQNYLYOWoEq"
,
"HZYMDVEERKoOrder"
,
"HEPOWBSYEVoADD"
,
"OHGNYTNLSCoASHE"
,
"cdb_saltNDFPJCCDAO"
};
initGfb
(
names
,
types
,
lengths
,
"micro_db"
,
"int_table"
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment