Index: src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp
===================================================================
--- src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -114,8 +114,8 @@
  * \param _jobs jobs to add
  */
-void ReceiveJobsOperation::addJobs(const std::vector<FragmentJob> &_jobs)
+void ReceiveJobsOperation::addJobs(const std::vector<FragmentJob::ptr> &_jobs)
 {
   jobs.reserve(jobs.size()+_jobs.size());
-  BOOST_FOREACH(FragmentJob job, _jobs) {
+  BOOST_FOREACH(FragmentJob::ptr job, _jobs) {
     jobs.push_back(job);
   }
Index: src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp
===================================================================
--- src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -40,5 +40,5 @@
 
   /// Setter for jobs
-  void addJobs(const std::vector<FragmentJob> &jobs);
+  void addJobs(const std::vector<FragmentJob::ptr> &jobs);
 
   /** Getter for number of jobs present in the queue.
@@ -55,5 +55,5 @@
 
   /// bunch of jobs
-  std::vector<FragmentJob> jobs;
+  std::vector<FragmentJob::ptr> jobs;
 };
 
Index: src/Fragmentation/Automation/FragmentJob.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentJob.hpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentJob.hpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -16,5 +16,7 @@
 #include <string>
 
-#include "boost/serialization/array.hpp"
+#include "boost/shared_ptr.hpp"
+#include "boost/serialization/access.hpp"
+#include "boost/serialization/shared_ptr.hpp"
 
 #include "FragmentResult.hpp"
@@ -39,4 +41,6 @@
   friend class FragmentJobTest;
 public:
+  typedef boost::shared_ptr<FragmentJob> ptr;
+
   FragmentJob();
   FragmentJob(const std::string &_command, const std::string &_outputfile, const JobId_t _JobId);
Index: src/Fragmentation/Automation/FragmentQueue.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentQueue.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentQueue.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -38,5 +38,8 @@
  */
 FragmentQueue::~FragmentQueue()
-{}
+{
+  jobs.clear();
+  results.clear();
+}
 
 /** Checks whether there are jobs in the queue at all.
@@ -54,11 +57,11 @@
  * \param job job to enter into queue
  */
-void FragmentQueue::pushJob(FragmentJob &job)
-{
-  ASSERT(job.getId() != JobId::IllegalJob,
+void FragmentQueue::pushJob(FragmentJob::ptr job)
+{
+  ASSERT(job->getId() != JobId::IllegalJob,
       "FragmentQueue::pushJob() - job to push has IllegalJob id.");
-  ASSERT(!results.count(job.getId()),
-      "FragmentQueue::pushJob() - job id "+toString(job.getId())+" has already been used.");
-  results.insert( std::make_pair(job.getId(), NoResult));
+  ASSERT(!results.count(job->getId()),
+      "FragmentQueue::pushJob() - job id "+toString(job->getId())+" has already been used.");
+  results.insert( std::make_pair(job->getId(), NoResult));
   jobs.push_back(job);
 }
@@ -72,7 +75,7 @@
  * \param _jobs jobs to enter into queue
  */
-void FragmentQueue::pushJobs(std::vector<FragmentJob> &_jobs)
-{
-  for (std::vector<FragmentJob>::iterator iter = _jobs.begin();
+void FragmentQueue::pushJobs(std::vector<FragmentJob::ptr> &_jobs)
+{
+  for (std::vector<FragmentJob::ptr>::iterator iter = _jobs.begin();
       iter != _jobs.end(); ++iter)
     pushJob(*iter);
@@ -85,12 +88,12 @@
  * \return job topmost job from queue
  */
-FragmentJob FragmentQueue::popJob()
+FragmentJob::ptr FragmentQueue::popJob()
 {
   ASSERT(jobs.size(),
       "FragmentQueue::popJob() - there are no jobs on the queue.");
-  FragmentJob job = jobs.front();
-  ResultMap::iterator iter = results.find(job.getId());
+  FragmentJob::ptr job = jobs.front();
+  ResultMap::iterator iter = results.find(job->getId());
   ASSERT(iter != results.end(),
-      "FragmentQueue::popJob() - for job "+toString(job.getId())+" no result place has been stored.");
+      "FragmentQueue::popJob() - for job "+toString(job->getId())+" no result place has been stored.");
   iter->second = NoResultQueued;
   jobs.pop_front();
Index: src/Fragmentation/Automation/FragmentQueue.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentQueue.hpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentQueue.hpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -36,7 +36,7 @@
 
   // entering jobs into queue
-  void pushJob(FragmentJob &job);
-  void pushJobs(std::vector<FragmentJob> &_jobs);
-  FragmentJob popJob();
+  void pushJob(FragmentJob::ptr job);
+  void pushJobs(std::vector<FragmentJob::ptr> &_jobs);
+  FragmentJob::ptr popJob();
   bool isJobPresent() const;
 
@@ -59,5 +59,5 @@
   static FragmentResult ResultDelivered;
 
-  typedef std::deque<FragmentJob> JobQueue;
+  typedef std::deque<FragmentJob::ptr> JobQueue;
   typedef std::map<JobId_t, FragmentResult> ResultMap;
 
Index: src/Fragmentation/Automation/FragmentScheduler.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentScheduler.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentScheduler.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -39,5 +39,5 @@
 #include "FragmentScheduler.hpp"
 
-FragmentJob FragmentScheduler::NoJob(std::string("/bin/false"), std::string("NoJob"), JobId::NoJob);
+FragmentJob::ptr FragmentScheduler::NoJob(new FragmentJob(std::string("/bin/false"), std::string("NoJob"), JobId::NoJob));
 
 /** Constructor of class FragmentScheduler.
@@ -115,8 +115,8 @@
     if (JobsQueue.isJobPresent()) {
       // pop a job and send it to the client.
-      FragmentJob job(JobsQueue.popJob());
+      FragmentJob::ptr job(JobsQueue.popJob());
       // The connection::async_write() function will automatically
       // serialize the data structure for us.
-      LOG(1, "INFO: Sending job #" << job.getId() << ".");
+      LOG(1, "INFO: Sending job #" << job->getId() << ".");
       conn->async_write(job,
         boost::bind(&FragmentScheduler::handle_SendJobtoWorker, this,
Index: src/Fragmentation/Automation/FragmentScheduler.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentScheduler.hpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentScheduler.hpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -94,5 +94,5 @@
 
   /// bunch of jobs received from controller before placed in JobsQueue
-  std::vector<FragmentJob> jobs;
+  std::vector<FragmentJob::ptr> jobs;
 
   /// number of jobs that are calculated, required for returning status
@@ -106,5 +106,5 @@
 
   // static entity to indicate to clients that the queue is empty.
-  static FragmentJob NoJob;
+  static FragmentJob::ptr NoJob;
 
   // Exit flag on program exit
Index: src/Fragmentation/Automation/FragmentWorker.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentWorker.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentWorker.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -99,16 +99,16 @@
   if (!e)
   {
-    LOG(1, "INFO: Received job #" << job.getId() << ".");
-    if (job.getId() != JobId::NoJob) {
+    LOG(1, "INFO: Received job #" << job->getId() << ".");
+    if (job->getId() != JobId::NoJob) {
       // Print out the data that was received.
-      std::cout << "Job output: " << job.outputfile << "\n";
-      std::cout << "Job id: " << job.getId() << "\n";
+      std::cout << "Job output: " << job->outputfile << "\n";
+      std::cout << "Job id: " << job->getId() << "\n";
 
       // do something .. right now: wait
-      LOG(1, "INFO: Calculating job #" << job.getId() << " ...");
-      FragmentResult result(job.Work());
+      LOG(1, "INFO: Calculating job #" << job->getId() << " ...");
+      FragmentResult result(job->Work());
 
       // write the result to the server
-      LOG(1, "INFO: Sending result for job #" << job.getId() << " ...");
+      LOG(1, "INFO: Sending result for job #" << job->getId() << " ...");
       connection_.async_write(result,
         boost::bind(&FragmentWorker::handle_SendResult, this,
@@ -141,7 +141,7 @@
   Info info(__FUNCTION__);
   // Nothing to do.
-  LOG(1, "INFO: Job #" << job.getId() << " calculated and sent.");
+  LOG(1, "INFO: Job #" << job->getId() << " calculated and sent.");
   // erase job
-  job = FragmentJob();
+  job = FragmentJob::ptr(new FragmentJob());
 }
 
Index: src/Fragmentation/Automation/FragmentWorker.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentWorker.hpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/FragmentWorker.hpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -62,5 +62,5 @@
 
   /// The data received from the server.
-  FragmentJob job;
+  FragmentJob::ptr job;
 
   /// The result created to be sent to the server.
Index: src/Fragmentation/Automation/controller.cpp
===================================================================
--- src/Fragmentation/Automation/controller.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/controller.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -50,13 +50,13 @@
 };
 
-void createjobs(std::vector<FragmentJob> &jobs)
-{
-  FragmentJob testJob(std::string("cat"), std::string("Nothing"), 1);
-  FragmentJob othertestJob(std::string("cat"), std::string("Nothing"), 2);
+void createjobs(std::vector<FragmentJob::ptr> &jobs)
+{
+  FragmentJob::ptr testJob( new FragmentJob( std::string("cat"), std::string("Nothing"), 1) );
+  FragmentJob::ptr othertestJob( new FragmentJob( std::string("cat"), std::string("Nothing"), 2) );
   jobs.push_back(testJob);
   jobs.push_back(othertestJob);
 }
 
-void addjobs(FragmentController &controller, std::vector<FragmentJob> &jobs)
+void addjobs(FragmentController &controller, std::vector<FragmentJob::ptr> &jobs)
 {
   ReceiveJobsOperation *recjobs = static_cast<ReceiveJobsOperation *>(
@@ -156,5 +156,5 @@
       case SendJobsIndex:
       {
-        std::vector<FragmentJob> jobs;
+        std::vector<FragmentJob::ptr> jobs;
         createjobs(jobs);
         addjobs(controller, jobs);
Index: src/Fragmentation/Automation/unittests/FragmentJobUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/FragmentJobUnitTest.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/unittests/FragmentJobUnitTest.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -62,15 +62,15 @@
 void FragmentJobTest::equalityTest()
 {
-  FragmentJob testJob(command, outputfile, 1);
-  FragmentJob sameIdJob(command, outputfile, 1);
-  FragmentJob otherIdJob(command, outputfile, 2);
-  FragmentJob copiedJob(testJob);
-  FragmentJob copiedchangedJob(testJob);
-  copiedchangedJob.setId(3);
+  FragmentJob::ptr testJob(new FragmentJob(command, outputfile, 1));
+  FragmentJob::ptr sameIdJob(new FragmentJob(command, outputfile, 1));
+  FragmentJob::ptr otherIdJob(new FragmentJob(command, outputfile, 2));
+  FragmentJob::ptr copiedJob(new FragmentJob(*testJob));
+  FragmentJob::ptr copiedchangedJob(new FragmentJob(*testJob));
+  copiedchangedJob->setId(3);
 
-  CPPUNIT_ASSERT( testJob == sameIdJob );
-  CPPUNIT_ASSERT( testJob != otherIdJob );
-  CPPUNIT_ASSERT( testJob == copiedJob );
-  CPPUNIT_ASSERT( testJob != copiedchangedJob );
+  CPPUNIT_ASSERT( *testJob == *sameIdJob );
+  CPPUNIT_ASSERT( *testJob != *otherIdJob );
+  CPPUNIT_ASSERT( *testJob == *copiedJob );
+  CPPUNIT_ASSERT( *testJob != *copiedchangedJob );
 }
 
@@ -79,9 +79,9 @@
 void FragmentJobTest::WorkTest()
 {
-  FragmentJob testJob(command, outputfile, 1);
-  FragmentJob othertestJob(command, outputfile, 2);
+  FragmentJob::ptr testJob(new FragmentJob(command, outputfile, 1));
+  FragmentJob::ptr othertestJob(new FragmentJob(command, outputfile, 2));
 
-  FragmentResult testResult(testJob.Work());
-  FragmentResult othertestResult(othertestJob.Work());
+  FragmentResult testResult(testJob->Work());
+  FragmentResult othertestResult(othertestJob->Work());
 
   CPPUNIT_ASSERT_EQUAL( (JobId_t)1, testResult.getId() );
@@ -93,5 +93,5 @@
 void FragmentJobTest::serializationTest()
 {
-  FragmentJob testJob(command, outputfile, 1);
+  FragmentJob::ptr testJob(new FragmentJob(command, outputfile, 1));
   // write element to stream
   std::stringstream stream;
@@ -104,9 +104,9 @@
   boost::archive::text_iarchive ia(stream);
   // read class state from archive
-  FragmentJob otherJob;
+  FragmentJob::ptr otherJob;
 
   ia >> otherJob;
 
-  CPPUNIT_ASSERT (testJob == otherJob);
+  CPPUNIT_ASSERT (*testJob == *otherJob);
 }
 
Index: src/Fragmentation/Automation/unittests/FragmentQueueUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/FragmentQueueUnitTest.cpp	(revision 142ff51c118d30eab5f5726ee90599beb92383ba)
+++ src/Fragmentation/Automation/unittests/FragmentQueueUnitTest.cpp	(revision 78ad7d0534dc558c9de4b6b9d54bcc8e4dea409f)
@@ -58,5 +58,5 @@
 void FragmentQueueTest::JobTest()
 {
-  FragmentJob testJob;
+  FragmentJob::ptr testJob(new FragmentJob);
   /// check for illegal id
 #ifndef NDEBUG
@@ -65,6 +65,6 @@
 #endif
   // set to valid id
-  testJob.setId(1);
-  testJob.outputfile = std::string("do something");
+  testJob->setId(1);
+  testJob->outputfile = std::string("do something");
 
   CPPUNIT_ASSERT_EQUAL(false, queue->isJobPresent() );
@@ -94,5 +94,5 @@
   CPPUNIT_ASSERT_EQUAL((size_t)1, queue->results.size());
 
-  FragmentJob poppedJob;
+  FragmentJob::ptr poppedJob;
 #ifndef NDEBUG
   CPPUNIT_ASSERT_NO_THROW( poppedJob = queue->popJob() );
@@ -122,18 +122,18 @@
 {
   // prepare some jobs
-  FragmentJob testJob;
-  testJob.setId((JobId_t)1);
-  testJob.outputfile = std::string("do something");
-  FragmentJob anothertestJob;
-  anothertestJob.setId((JobId_t)2);
-  anothertestJob.outputfile = std::string("do something else");
+  FragmentJob::ptr testJob(new FragmentJob);
+  testJob->setId((JobId_t)1);
+  testJob->outputfile = std::string("do something");
+  FragmentJob::ptr anothertestJob(new FragmentJob);
+  anothertestJob->setId((JobId_t)2);
+  anothertestJob->outputfile = std::string("do something else");
 
   // prepare a vector of them
-  std::vector<FragmentJob> testjobs;
+  std::vector<FragmentJob::ptr> testjobs;
   testjobs.push_back(testJob);
   testjobs.push_back(anothertestJob);
 
   // prepare another vector of them
-  std::vector<FragmentJob> sametestjobs;
+  std::vector<FragmentJob::ptr> sametestjobs;
   sametestjobs.push_back(testJob);
   sametestjobs.push_back(anothertestJob);
@@ -173,7 +173,7 @@
 {
   // prepare a job
-  FragmentJob testJob;
-  testJob.setId(1);
-  testJob.outputfile = std::string("do something");
+  FragmentJob::ptr testJob(new FragmentJob);
+  testJob->setId(1);
+  testJob->outputfile = std::string("do something");
 #ifndef NDEBUG
   CPPUNIT_ASSERT_NO_THROW( queue->pushJob(testJob) );
@@ -240,10 +240,10 @@
 {
   // prepare a job
-  FragmentJob testJob;
-  testJob.setId(1);
-  testJob.outputfile = std::string("do something");
-  FragmentJob anothertestJob;
-  anothertestJob.setId(2);
-  anothertestJob.outputfile = std::string("do something else");
+  FragmentJob::ptr testJob( new FragmentJob );
+  testJob->setId(1);
+  testJob->outputfile = std::string("do something");
+  FragmentJob::ptr anothertestJob( new FragmentJob );
+  anothertestJob->setId(2);
+  anothertestJob->outputfile = std::string("do something else");
 
 #ifndef NDEBUG
